Merge branch 'master' into screen

Signed-off-by: Paulo Flabiano Smorigo <pfsmorigo@gmail.com>
This commit is contained in:
Paulo Flabiano Smorigo 2020-09-03 06:37:13 -03:00
commit 50708c4f88
No known key found for this signature in database
GPG Key ID: 6D4A7990BDE2CC66
5 changed files with 129 additions and 101 deletions

View File

@ -37,11 +37,11 @@ This theme is based loosely on [agnoster][agnoster].
### The Prompt ### The Prompt
* Flags: * Status flags:
* Previous command failed (**`!`**) * Previous command failed (**`!`**)
* Background jobs (**`%`**) * Private mode (**🔒** or **`⦸`**)
* You currently have superpowers (**`$`**) * You currently have superpowers (**`$`**)
* Cursor on newline * Background jobs (**`%`**)
* Current vi mode * Current vi mode
* `User@Host` (unless you're the default user) * `User@Host` (unless you're the default user)
* Current RVM, rbenv or chruby (Ruby) version * Current RVM, rbenv or chruby (Ruby) version

View File

@ -413,7 +413,7 @@ end
# Status segment # Status segment
# ============================== # ==============================
function __bobthefish_prompt_status -S -a last_status -d 'Display flags for a non-zero exit status, root user, and background jobs' function __bobthefish_prompt_status -S -a last_status -d 'Display flags for a non-zero exit status, private mode, root user, and background jobs'
set -l nonzero set -l nonzero
set -l superuser set -l superuser
set -l bg_jobs set -l bg_jobs
@ -453,7 +453,7 @@ function __bobthefish_prompt_status -S -a last_status -d 'Display flags for a no
end end
end end
if [ "$nonzero" -o "$superuser" -o "$bg_jobs" ] if [ "$nonzero" -o "$fish_private_mode" -o "$superuser" -o "$bg_jobs" ]
__bobthefish_start_segment $color_initial_segment_exit __bobthefish_start_segment $color_initial_segment_exit
if [ "$nonzero" ] if [ "$nonzero" ]
set_color normal set_color normal
@ -465,6 +465,12 @@ function __bobthefish_prompt_status -S -a last_status -d 'Display flags for a no
end end
end end
if [ "$fish_private_mode" ]
set_color normal
set_color -b $color_initial_segment_private
echo -n $private_glyph
end
if [ "$superuser" ] if [ "$superuser" ]
set_color normal set_color normal
if [ -z "$FAKEROOTKEY" ] if [ -z "$FAKEROOTKEY" ]

View File

@ -8,6 +8,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l colorfg black set -l colorfg black
[ "$color_scheme" = 'terminal-dark-white' ]; and set colorfg white [ "$color_scheme" = 'terminal-dark-white' ]; and set colorfg white
set -x color_initial_segment_exit white red --bold set -x color_initial_segment_exit white red --bold
set -x color_initial_segment_private white black
set -x color_initial_segment_su white green --bold set -x color_initial_segment_su white green --bold
set -x color_initial_segment_jobs white blue --bold set -x color_initial_segment_jobs white blue --bold
@ -41,6 +42,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l colorfg white set -l colorfg white
[ "$color_scheme" = 'terminal-light-black' ]; and set colorfg black [ "$color_scheme" = 'terminal-light-black' ]; and set colorfg black
set -x color_initial_segment_exit black red --bold set -x color_initial_segment_exit black red --bold
set -x color_initial_segment_private black white
set -x color_initial_segment_su black green --bold set -x color_initial_segment_su black green --bold
set -x color_initial_segment_jobs black blue --bold set -x color_initial_segment_jobs black blue --bold
@ -74,6 +76,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l colorfg black set -l colorfg black
[ "$color_scheme" = 'terminal2-dark-white' ]; and set colorfg white [ "$color_scheme" = 'terminal2-dark-white' ]; and set colorfg white
set -x color_initial_segment_exit grey red --bold set -x color_initial_segment_exit grey red --bold
set -x color_initial_segment_private grey black
set -x color_initial_segment_su grey green --bold set -x color_initial_segment_su grey green --bold
set -x color_initial_segment_jobs grey blue --bold set -x color_initial_segment_jobs grey blue --bold
@ -107,6 +110,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l colorfg white set -l colorfg white
[ "$color_scheme" = 'terminal2-light-black' ]; and set colorfg black [ "$color_scheme" = 'terminal2-light-black' ]; and set colorfg black
set -x color_initial_segment_exit brgrey red --bold set -x color_initial_segment_exit brgrey red --bold
set -x color_initial_segment_private brgrey black
set -x color_initial_segment_su brgrey green --bold set -x color_initial_segment_su brgrey green --bold
set -x color_initial_segment_jobs brgrey blue --bold set -x color_initial_segment_jobs brgrey blue --bold
@ -146,6 +150,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l white DCDCCC set -l white DCDCCC
set -x color_initial_segment_exit $white $red --bold set -x color_initial_segment_exit $white $red --bold
set -x color_initial_segment_private $white $grey
set -x color_initial_segment_su $white $green --bold set -x color_initial_segment_su $white $green --bold
set -x color_initial_segment_jobs $white $blue --bold set -x color_initial_segment_jobs $white $blue --bold
@ -196,6 +201,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l colorfg $base00 set -l colorfg $base00
set -x color_initial_segment_exit $base02 $base08 --bold set -x color_initial_segment_exit $base02 $base08 --bold
set -x color_initial_segment_private $base02 $base06
set -x color_initial_segment_su $base02 $base0B --bold set -x color_initial_segment_su $base02 $base0B --bold
set -x color_initial_segment_jobs $base02 $base0D --bold set -x color_initial_segment_jobs $base02 $base0D --bold
@ -246,6 +252,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l colorfg $base07 set -l colorfg $base07
set -x color_initial_segment_exit $base05 $base08 --bold set -x color_initial_segment_exit $base05 $base08 --bold
set -x color_initial_segment_private $base05 $base02
set -x color_initial_segment_su $base05 $base0B --bold set -x color_initial_segment_su $base05 $base0B --bold
set -x color_initial_segment_jobs $base05 $base0D --bold set -x color_initial_segment_jobs $base05 $base0D --bold
@ -296,6 +303,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set colorfg $base03 set colorfg $base03
set -x color_initial_segment_exit $base02 $red --bold set -x color_initial_segment_exit $base02 $red --bold
set -x color_initial_segment_private $base02 $base2
set -x color_initial_segment_su $base02 $green --bold set -x color_initial_segment_su $base02 $green --bold
set -x color_initial_segment_jobs $base02 $blue --bold set -x color_initial_segment_jobs $base02 $blue --bold
@ -346,6 +354,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set colorfg $base3 set colorfg $base3
set -x color_initial_segment_exit $base2 $red --bold set -x color_initial_segment_exit $base2 $red --bold
set -x color_initial_segment_private $base2 $base02
set -x color_initial_segment_su $base2 $green --bold set -x color_initial_segment_su $base2 $green --bold
set -x color_initial_segment_jobs $base2 $blue --bold set -x color_initial_segment_jobs $base2 $blue --bold
@ -389,6 +398,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l ruby_red af0000 set -l ruby_red af0000
set -x color_initial_segment_exit $grey[3] $red[2] --bold set -x color_initial_segment_exit $grey[3] $red[2] --bold
set -x color_initial_segment_private $grey[3] $grey[1]
set -x color_initial_segment_su $grey[3] $green[2] --bold set -x color_initial_segment_su $grey[3] $green[2] --bold
set -x color_initial_segment_jobs $grey[3] $blue[3] --bold set -x color_initial_segment_jobs $grey[3] $blue[3] --bold
@ -431,6 +441,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l bg 504945 282828 set -l bg 504945 282828
set -x color_initial_segment_exit $fg[1] $red[2] --bold set -x color_initial_segment_exit $fg[1] $red[2] --bold
set -x color_initial_segment_private $fg[1] $bg[1]
set -x color_initial_segment_su $fg[1] $green[2] --bold set -x color_initial_segment_su $fg[1] $green[2] --bold
set -x color_initial_segment_jobs $fg[1] $aqua[2] --bold set -x color_initial_segment_jobs $fg[1] $aqua[2] --bold
@ -475,6 +486,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l yellow f1fa8c set -l yellow f1fa8c
set -x color_initial_segment_exit $fg $red --bold set -x color_initial_segment_exit $fg $red --bold
set -x color_initial_segment_private $fg $selection
set -x color_initial_segment_su $fg $purple --bold set -x color_initial_segment_su $fg $purple --bold
set -x color_initial_segment_jobs $fg $comment --bold set -x color_initial_segment_jobs $fg $comment --bold
@ -525,6 +537,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l colorfg $base00 set -l colorfg $base00
set -x color_initial_segment_exit $base05 $base08 --bold set -x color_initial_segment_exit $base05 $base08 --bold
set -x color_initial_segment_private $base05 $base02
set -x color_initial_segment_su $base05 $base0B --bold set -x color_initial_segment_su $base05 $base0B --bold
set -x color_initial_segment_jobs $base08 $base0D --bold set -x color_initial_segment_jobs $base08 $base0D --bold
@ -568,6 +581,7 @@ function __bobthefish_colors -S -a color_scheme -d 'Define colors used by bobthe
set -l go_blue 00d7d7 set -l go_blue 00d7d7
set -x color_initial_segment_exit $white $red[2] --bold set -x color_initial_segment_exit $white $red[2] --bold
set -x color_initial_segment_private $white $grey[3]
set -x color_initial_segment_su $white $green[2] --bold set -x color_initial_segment_su $white $green[2] --bold
set -x color_initial_segment_jobs $white $blue[3] --bold set -x color_initial_segment_jobs $white $blue[3] --bold
@ -601,6 +615,7 @@ end
function __bobthefish_user_color_scheme_deprecated function __bobthefish_user_color_scheme_deprecated
set -q __color_initial_segment_exit; or set -l __color_initial_segment_exit ffffff ce000f --bold set -q __color_initial_segment_exit; or set -l __color_initial_segment_exit ffffff ce000f --bold
set -q __color_initial_segment_private; or set -l __color_initial_segment_private ffffff 255e87
set -q __color_initial_segment_su; or set -l __color_initial_segment_su ffffff 189303 --bold set -q __color_initial_segment_su; or set -l __color_initial_segment_su ffffff 189303 --bold
set -q __color_initial_segment_jobs; or set -l __color_initial_segment_jobs ffffff 255e87 --bold set -q __color_initial_segment_jobs; or set -l __color_initial_segment_jobs ffffff 255e87 --bold
set -q __color_path; or set -l __color_path 333333 999999 set -q __color_path; or set -l __color_path 333333 999999
@ -638,6 +653,7 @@ function __bobthefish_user_color_scheme_deprecated
# then override everything you want! note that these must be defined with `set -x` # then override everything you want! note that these must be defined with `set -x`
set -x color_initial_segment_exit $__color_initial_segment_exit set -x color_initial_segment_exit $__color_initial_segment_exit
set -x color_initial_segment_private $__color_initial_segment_private
set -x color_initial_segment_su $__color_initial_segment_su set -x color_initial_segment_su $__color_initial_segment_su
set -x color_initial_segment_jobs $__color_initial_segment_jobs set -x color_initial_segment_jobs $__color_initial_segment_jobs
set -x color_path $__color_path set -x color_path $__color_path

View File

@ -10,6 +10,7 @@ function __bobthefish_glyphs -S -d 'Define glyphs used by bobthefish'
set -x detached_glyph \u27A6 set -x detached_glyph \u27A6
set -x tag_glyph \u2302 set -x tag_glyph \u2302
set -x nonzero_exit_glyph '! ' set -x nonzero_exit_glyph '! '
set -x private_glyph \uE0A2 ' '
set -x superuser_glyph '$ ' set -x superuser_glyph '$ '
set -x bg_job_glyph '% ' set -x bg_job_glyph '% '
set -x hg_glyph \u263F set -x hg_glyph \u263F
@ -50,6 +51,7 @@ function __bobthefish_glyphs -S -d 'Define glyphs used by bobthefish'
# Disable Powerline fonts (unless we're using nerd fonts instead) # Disable Powerline fonts (unless we're using nerd fonts instead)
if [ "$theme_powerline_fonts" = "no" -a "$theme_nerd_fonts" != "yes" ] if [ "$theme_powerline_fonts" = "no" -a "$theme_nerd_fonts" != "yes" ]
set private_glyph \u29B8 ' '
set branch_glyph \u2387 set branch_glyph \u2387
set right_black_arrow_glyph '' set right_black_arrow_glyph ''
set right_arrow_glyph '' set right_arrow_glyph ''
@ -59,6 +61,8 @@ function __bobthefish_glyphs -S -d 'Define glyphs used by bobthefish'
# Use prettier Nerd Fonts glyphs # Use prettier Nerd Fonts glyphs
if [ "$theme_nerd_fonts" = "yes" ] if [ "$theme_nerd_fonts" = "yes" ]
set private_glyph \uF023 ' ' # nf-fa-lock
set branch_glyph \uF418 set branch_glyph \uF418
set detached_glyph \uF417 set detached_glyph \uF417
set tag_glyph \uF412 set tag_glyph \uF412

View File

@ -4,7 +4,7 @@ function bobthefish_display_colors -a color_scheme -d 'Print example prompt colo
solarized solarized-light \ solarized solarized-light \
base16 base16-light \ base16 base16-light \
gruvbox zenburn \ gruvbox zenburn \
dracula \ dracula nord \
terminal terminal-dark-white \ terminal terminal-dark-white \
terminal-light terminal-light-black \ terminal-light terminal-light-black \
terminal2 terminal2-dark-white \ terminal2 terminal2-dark-white \
@ -49,6 +49,8 @@ function bobthefish_display_colors -a color_scheme -d 'Print example prompt colo
__bobthefish_start_segment $color_initial_segment_exit __bobthefish_start_segment $color_initial_segment_exit
echo -n exit $nonzero_exit_glyph echo -n exit $nonzero_exit_glyph
set_color -b $color_initial_segment_private
echo -n private $private_glyph
set_color -b $color_initial_segment_su set_color -b $color_initial_segment_su
echo -n su $superuser_glyph echo -n su $superuser_glyph
set_color -b $color_initial_segment_jobs set_color -b $color_initial_segment_jobs