|
|
|
@@ -51,14 +51,14 @@ function __bobthefish_git_branch -S -d 'Get the current git branch (or commitish
|
|
|
|
[ -n "$theme_git_default_branches" ]
|
|
|
|
[ -n "$theme_git_default_branches" ]
|
|
|
|
or set -l theme_git_default_branches master main (git config init.defaultBranch)
|
|
|
|
or set -l theme_git_default_branches master main (git config init.defaultBranch)
|
|
|
|
|
|
|
|
|
|
|
|
[ "$theme_display_git_master_branch" != 'yes' -a "$theme_display_git_default_branch" != 'yes' ]
|
|
|
|
[ "$theme_display_git_master_branch" != yes -a "$theme_display_git_default_branch" != yes ]
|
|
|
|
and contains $branch $theme_git_default_branches
|
|
|
|
and contains $branch $theme_git_default_branches
|
|
|
|
and echo $branch_glyph
|
|
|
|
and echo $branch_glyph
|
|
|
|
and return
|
|
|
|
and return
|
|
|
|
|
|
|
|
|
|
|
|
# truncate the middle of the branch name, but only if it's 25+ characters
|
|
|
|
# truncate the middle of the branch name, but only if it's 25+ characters
|
|
|
|
set -l truncname $branch
|
|
|
|
set -l truncname $branch
|
|
|
|
[ "$theme_use_abbreviated_branch_name" = 'yes' ]
|
|
|
|
[ "$theme_use_abbreviated_branch_name" = yes ]
|
|
|
|
and set truncname (string replace -r '^(.{17}).{3,}(.{5})$' "\$1…\$2" $branch)
|
|
|
|
and set truncname (string replace -r '^(.{17}).{3,}(.{5})$' "\$1…\$2" $branch)
|
|
|
|
|
|
|
|
|
|
|
|
echo $branch_glyph $truncname
|
|
|
|
echo $branch_glyph $truncname
|
|
|
|
@@ -117,7 +117,7 @@ function __bobthefish_ignore_vcs_dir -a real_pwd -d 'Check whether the current d
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function __bobthefish_git_project_dir -S -a real_pwd -d 'Print the current git project base directory'
|
|
|
|
function __bobthefish_git_project_dir -S -a real_pwd -d 'Print the current git project base directory'
|
|
|
|
[ "$theme_display_git" = 'no' ]
|
|
|
|
[ "$theme_display_git" = no ]
|
|
|
|
and return
|
|
|
|
and return
|
|
|
|
|
|
|
|
|
|
|
|
command -q git
|
|
|
|
command -q git
|
|
|
|
@@ -127,7 +127,7 @@ function __bobthefish_git_project_dir -S -a real_pwd -d 'Print the current git p
|
|
|
|
and [ (__bobthefish_ignore_vcs_dir $real_pwd) ]
|
|
|
|
and [ (__bobthefish_ignore_vcs_dir $real_pwd) ]
|
|
|
|
and return
|
|
|
|
and return
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$theme_git_worktree_support" != 'yes' ]
|
|
|
|
if [ "$theme_git_worktree_support" != yes ]
|
|
|
|
set -l git_toplevel (command git rev-parse --show-toplevel 2>/dev/null)
|
|
|
|
set -l git_toplevel (command git rev-parse --show-toplevel 2>/dev/null)
|
|
|
|
|
|
|
|
|
|
|
|
[ -z "$git_toplevel" ]
|
|
|
|
[ -z "$git_toplevel" ]
|
|
|
|
@@ -152,7 +152,7 @@ function __bobthefish_git_project_dir -S -a real_pwd -d 'Print the current git p
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
[ "$d" = '/' ]
|
|
|
|
[ "$d" = / ]
|
|
|
|
and return
|
|
|
|
and return
|
|
|
|
|
|
|
|
|
|
|
|
set d (__bobthefish_dirname $d)
|
|
|
|
set d (__bobthefish_dirname $d)
|
|
|
|
@@ -199,7 +199,7 @@ function __bobthefish_git_project_dir -S -a real_pwd -d 'Print the current git p
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function __bobthefish_fossil_project_dir -S -a real_pwd -d 'Print the current fossil project base directory'
|
|
|
|
function __bobthefish_fossil_project_dir -S -a real_pwd -d 'Print the current fossil project base directory'
|
|
|
|
[ "$theme_display_fossil" = 'yes' ]
|
|
|
|
[ "$theme_display_fossil" = yes ]
|
|
|
|
and command -q fossil
|
|
|
|
and command -q fossil
|
|
|
|
and set -f dir (command fossil json status 2>/dev/null | grep localRoot | string split ':' -f2 | string trim --chars='"/,')
|
|
|
|
and set -f dir (command fossil json status 2>/dev/null | grep localRoot | string split ':' -f2 | string trim --chars='"/,')
|
|
|
|
or return
|
|
|
|
or return
|
|
|
|
@@ -212,7 +212,7 @@ function __bobthefish_fossil_project_dir -S -a real_pwd -d 'Print the current fo
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function __bobthefish_hg_project_dir -S -a real_pwd -d 'Print the current hg project base directory'
|
|
|
|
function __bobthefish_hg_project_dir -S -a real_pwd -d 'Print the current hg project base directory'
|
|
|
|
[ "$theme_display_hg" = 'yes' ]
|
|
|
|
[ "$theme_display_hg" = yes ]
|
|
|
|
and command -q hg
|
|
|
|
and command -q hg
|
|
|
|
or return
|
|
|
|
or return
|
|
|
|
|
|
|
|
|
|
|
|
@@ -227,7 +227,7 @@ function __bobthefish_hg_project_dir -S -a real_pwd -d 'Print the current hg pro
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
[ "$d" = '/' ]
|
|
|
|
[ "$d" = / ]
|
|
|
|
and return
|
|
|
|
and return
|
|
|
|
|
|
|
|
|
|
|
|
set d (__bobthefish_dirname $d)
|
|
|
|
set d (__bobthefish_dirname $d)
|
|
|
|
@@ -249,7 +249,7 @@ function __bobthefish_project_pwd -S -a project_root_dir -a real_pwd -d 'Print t
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function __bobthefish_git_ahead -S -d 'Print the ahead/behind state for the current branch'
|
|
|
|
function __bobthefish_git_ahead -S -d 'Print the ahead/behind state for the current branch'
|
|
|
|
if [ "$theme_display_git_ahead_verbose" = 'yes' ]
|
|
|
|
if [ "$theme_display_git_ahead_verbose" = yes ]
|
|
|
|
__bobthefish_git_ahead_verbose
|
|
|
|
__bobthefish_git_ahead_verbose
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
@@ -308,7 +308,7 @@ function __bobthefish_git_dirty_verbose -S -d 'Print a more verbose dirty state
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function __bobthefish_git_stashed -S -d 'Print the stashed state for the current branch'
|
|
|
|
function __bobthefish_git_stashed -S -d 'Print the stashed state for the current branch'
|
|
|
|
if [ "$theme_display_git_stashed_verbose" = 'yes' ]
|
|
|
|
if [ "$theme_display_git_stashed_verbose" = yes ]
|
|
|
|
set -l stashed (command git rev-list --walk-reflogs --count refs/stash 2>/dev/null)
|
|
|
|
set -l stashed (command git rev-list --walk-reflogs --count refs/stash 2>/dev/null)
|
|
|
|
or return
|
|
|
|
or return
|
|
|
|
|
|
|
|
|
|
|
|
@@ -319,7 +319,6 @@ function __bobthefish_git_stashed -S -d 'Print the stashed state for the current
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ==============================
|
|
|
|
# ==============================
|
|
|
|
# Segment functions
|
|
|
|
# Segment functions
|
|
|
|
# ==============================
|
|
|
|
# ==============================
|
|
|
|
@@ -366,7 +365,7 @@ function __bobthefish_path_segment -S -a segment_dir -a path_type -d 'Display a
|
|
|
|
|
|
|
|
|
|
|
|
switch "$segment_dir"
|
|
|
|
switch "$segment_dir"
|
|
|
|
case /
|
|
|
|
case /
|
|
|
|
set directory '/'
|
|
|
|
set directory /
|
|
|
|
case "$HOME"
|
|
|
|
case "$HOME"
|
|
|
|
set directory '~'
|
|
|
|
set directory '~'
|
|
|
|
case '*'
|
|
|
|
case '*'
|
|
|
|
@@ -374,7 +373,7 @@ function __bobthefish_path_segment -S -a segment_dir -a path_type -d 'Display a
|
|
|
|
set directory (__bobthefish_basename "$segment_dir")
|
|
|
|
set directory (__bobthefish_basename "$segment_dir")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
[ "$theme_show_project_parent" != "no" -o "$path_type" != "project" ]
|
|
|
|
[ "$theme_show_project_parent" != no -o "$path_type" != project ]
|
|
|
|
and echo -n $parent
|
|
|
|
and echo -n $parent
|
|
|
|
|
|
|
|
|
|
|
|
set_color -b $segment_basename_color
|
|
|
|
set_color -b $segment_basename_color
|
|
|
|
@@ -388,18 +387,18 @@ function __bobthefish_finish_segments -S -d 'Close open prompt segments'
|
|
|
|
echo -ns $right_black_arrow_glyph ' '
|
|
|
|
echo -ns $right_black_arrow_glyph ' '
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$theme_newline_cursor" = 'yes' ]
|
|
|
|
if [ "$theme_newline_cursor" = yes ]
|
|
|
|
echo -ens "\n"
|
|
|
|
echo -ens "\n"
|
|
|
|
set_color $fish_color_autosuggestion
|
|
|
|
set_color $fish_color_autosuggestion
|
|
|
|
|
|
|
|
|
|
|
|
if set -q theme_newline_prompt
|
|
|
|
if set -q theme_newline_prompt
|
|
|
|
echo -ens "$theme_newline_prompt"
|
|
|
|
echo -ens "$theme_newline_prompt"
|
|
|
|
else if [ "$theme_powerline_fonts" = 'no' -a "$theme_nerd_fonts" != 'yes' ]
|
|
|
|
else if [ "$theme_powerline_fonts" = no -a "$theme_nerd_fonts" != yes ]
|
|
|
|
echo -ns '> '
|
|
|
|
echo -ns '> '
|
|
|
|
else
|
|
|
|
else
|
|
|
|
echo -ns "$right_arrow_glyph "
|
|
|
|
echo -ns "$right_arrow_glyph "
|
|
|
|
end
|
|
|
|
end
|
|
|
|
else if [ "$theme_newline_cursor" = 'clean' ]
|
|
|
|
else if [ "$theme_newline_cursor" = clean ]
|
|
|
|
echo -ens "\n"
|
|
|
|
echo -ens "\n"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
@@ -407,7 +406,6 @@ function __bobthefish_finish_segments -S -d 'Close open prompt segments'
|
|
|
|
set __bobthefish_current_bg
|
|
|
|
set __bobthefish_current_bg
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ==============================
|
|
|
|
# ==============================
|
|
|
|
# Status segment
|
|
|
|
# Status segment
|
|
|
|
# ==============================
|
|
|
|
# ==============================
|
|
|
|
@@ -439,7 +437,7 @@ function __bobthefish_prompt_status -S -a last_status -d 'Display flags for a no
|
|
|
|
[ "$bg_jobs" -eq 0 ]
|
|
|
|
[ "$bg_jobs" -eq 0 ]
|
|
|
|
and set bg_jobs # clear it out so it doesn't show when `0`
|
|
|
|
and set bg_jobs # clear it out so it doesn't show when `0`
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if [ "$theme_display_jobs_verbose" = 'yes' ]
|
|
|
|
if [ "$theme_display_jobs_verbose" = yes ]
|
|
|
|
set bg_jobs (jobs -p | wc -l)
|
|
|
|
set bg_jobs (jobs -p | wc -l)
|
|
|
|
[ "$bg_jobs" -eq 0 ]
|
|
|
|
[ "$bg_jobs" -eq 0 ]
|
|
|
|
and set bg_jobs # clear it out so it doesn't show when `0`
|
|
|
|
and set bg_jobs # clear it out so it doesn't show when `0`
|
|
|
|
@@ -457,7 +455,7 @@ function __bobthefish_prompt_status -S -a last_status -d 'Display flags for a no
|
|
|
|
if [ "$nonzero" ]
|
|
|
|
if [ "$nonzero" ]
|
|
|
|
set_color normal
|
|
|
|
set_color normal
|
|
|
|
set_color -b $color_initial_segment_exit
|
|
|
|
set_color -b $color_initial_segment_exit
|
|
|
|
if [ "$theme_show_exit_status" = 'yes' ]
|
|
|
|
if [ "$theme_show_exit_status" = yes ]
|
|
|
|
echo -ns $last_status ' '
|
|
|
|
echo -ns $last_status ' '
|
|
|
|
else
|
|
|
|
else
|
|
|
|
echo -n $nonzero_exit_glyph
|
|
|
|
echo -n $nonzero_exit_glyph
|
|
|
|
@@ -484,7 +482,7 @@ function __bobthefish_prompt_status -S -a last_status -d 'Display flags for a no
|
|
|
|
if [ "$bg_jobs" ]
|
|
|
|
if [ "$bg_jobs" ]
|
|
|
|
set_color normal
|
|
|
|
set_color normal
|
|
|
|
set_color -b $color_initial_segment_jobs
|
|
|
|
set_color -b $color_initial_segment_jobs
|
|
|
|
if [ "$theme_display_jobs_verbose" = 'yes' ]
|
|
|
|
if [ "$theme_display_jobs_verbose" = yes ]
|
|
|
|
echo -ns $bg_job_glyph $bg_jobs ' '
|
|
|
|
echo -ns $bg_job_glyph $bg_jobs ' '
|
|
|
|
else
|
|
|
|
else
|
|
|
|
echo -n $bg_job_glyph
|
|
|
|
echo -n $bg_job_glyph
|
|
|
|
@@ -493,13 +491,12 @@ function __bobthefish_prompt_status -S -a last_status -d 'Display flags for a no
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ==============================
|
|
|
|
# ==============================
|
|
|
|
# Container and VM segments
|
|
|
|
# Container and VM segments
|
|
|
|
# ==============================
|
|
|
|
# ==============================
|
|
|
|
|
|
|
|
|
|
|
|
function __bobthefish_prompt_vagrant -S -d 'Display Vagrant status'
|
|
|
|
function __bobthefish_prompt_vagrant -S -d 'Display Vagrant status'
|
|
|
|
[ "$theme_display_vagrant" = 'yes' -a -f Vagrantfile ]
|
|
|
|
[ "$theme_display_vagrant" = yes -a -f Vagrantfile ]
|
|
|
|
or return
|
|
|
|
or return
|
|
|
|
|
|
|
|
|
|
|
|
# .vagrant/machines/$machine/$provider/id
|
|
|
|
# .vagrant/machines/$machine/$provider/id
|
|
|
|
@@ -524,15 +521,15 @@ function __bobthefish_prompt_vagrant_vbox -S -a id -d 'Display VirtualBox Vagran
|
|
|
|
set -l vm_status (VBoxManage showvminfo --machinereadable $id 2>/dev/null | command grep 'VMState=' | tr -d '"' | cut -d '=' -f 2)
|
|
|
|
set -l vm_status (VBoxManage showvminfo --machinereadable $id 2>/dev/null | command grep 'VMState=' | tr -d '"' | cut -d '=' -f 2)
|
|
|
|
|
|
|
|
|
|
|
|
switch "$vm_status"
|
|
|
|
switch "$vm_status"
|
|
|
|
case 'running'
|
|
|
|
case running
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_running_glyph"
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_running_glyph"
|
|
|
|
case 'poweroff'
|
|
|
|
case poweroff
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_poweroff_glyph"
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_poweroff_glyph"
|
|
|
|
case 'aborted'
|
|
|
|
case aborted
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_aborted_glyph"
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_aborted_glyph"
|
|
|
|
case 'saved'
|
|
|
|
case saved
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_saved_glyph"
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_saved_glyph"
|
|
|
|
case 'stopping'
|
|
|
|
case stopping
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_stopping_glyph"
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_stopping_glyph"
|
|
|
|
case ''
|
|
|
|
case ''
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_unknown_glyph"
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_unknown_glyph"
|
|
|
|
@@ -565,15 +562,15 @@ function __bobthefish_prompt_vagrant_parallels -S -d 'Display Parallels Vagrant
|
|
|
|
set -l vm_status (prlctl list $id -o status 2>/dev/null | command tail -1)
|
|
|
|
set -l vm_status (prlctl list $id -o status 2>/dev/null | command tail -1)
|
|
|
|
|
|
|
|
|
|
|
|
switch "$vm_status"
|
|
|
|
switch "$vm_status"
|
|
|
|
case 'running'
|
|
|
|
case running
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_running_glyph"
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_running_glyph"
|
|
|
|
case 'stopped'
|
|
|
|
case stopped
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_poweroff_glyph"
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_poweroff_glyph"
|
|
|
|
case 'paused'
|
|
|
|
case paused
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_saved_glyph"
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_saved_glyph"
|
|
|
|
case 'suspended'
|
|
|
|
case suspended
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_saved_glyph"
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_saved_glyph"
|
|
|
|
case 'stopping'
|
|
|
|
case stopping
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_stopping_glyph"
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_stopping_glyph"
|
|
|
|
case ''
|
|
|
|
case ''
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_unknown_glyph"
|
|
|
|
set vagrant_status "$vagrant_status$vagrant_unknown_glyph"
|
|
|
|
@@ -587,7 +584,7 @@ function __bobthefish_prompt_vagrant_parallels -S -d 'Display Parallels Vagrant
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function __bobthefish_prompt_docker -S -d 'Display Docker machine name'
|
|
|
|
function __bobthefish_prompt_docker -S -d 'Display Docker machine name'
|
|
|
|
[ "$theme_display_docker_machine" = 'no' -o -z "$DOCKER_MACHINE_NAME" ]
|
|
|
|
[ "$theme_display_docker_machine" = no -o -z "$DOCKER_MACHINE_NAME" ]
|
|
|
|
and return
|
|
|
|
and return
|
|
|
|
|
|
|
|
|
|
|
|
__bobthefish_start_segment $color_vagrant
|
|
|
|
__bobthefish_start_segment $color_vagrant
|
|
|
|
@@ -623,36 +620,35 @@ function __bobthefish_k8s_namespace -S -d 'Get the current k8s namespace'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function __bobthefish_prompt_k8s_context -S -d 'Show current Kubernetes context'
|
|
|
|
function __bobthefish_prompt_k8s_context -S -d 'Show current Kubernetes context'
|
|
|
|
[ "$theme_display_k8s_context" = 'yes' ]
|
|
|
|
[ "$theme_display_k8s_context" = yes ]
|
|
|
|
or return
|
|
|
|
or return
|
|
|
|
|
|
|
|
|
|
|
|
set -l context (__bobthefish_k8s_context)
|
|
|
|
set -l context (__bobthefish_k8s_context)
|
|
|
|
or return
|
|
|
|
or return
|
|
|
|
|
|
|
|
|
|
|
|
[ "$theme_display_k8s_namespace" = 'yes' ]
|
|
|
|
[ "$theme_display_k8s_namespace" = yes ]
|
|
|
|
and set -l namespace (__bobthefish_k8s_namespace)
|
|
|
|
and set -l namespace (__bobthefish_k8s_namespace)
|
|
|
|
|
|
|
|
|
|
|
|
[ -z "$context" -o "$context" = 'default' ]
|
|
|
|
[ -z "$context" -o "$context" = default ]
|
|
|
|
and [ -z "$namespace" -o "$namespace" = 'default' ]
|
|
|
|
and [ -z "$namespace" -o "$namespace" = default ]
|
|
|
|
and return
|
|
|
|
and return
|
|
|
|
|
|
|
|
|
|
|
|
set -l segment $k8s_glyph ' '
|
|
|
|
set -l segment $k8s_glyph ' '
|
|
|
|
[ "$context" != 'default' ]
|
|
|
|
[ "$context" != default ]
|
|
|
|
and set segment $segment $context
|
|
|
|
and set segment $segment $context
|
|
|
|
[ "$namespace" != 'default' ]
|
|
|
|
[ "$namespace" != default ]
|
|
|
|
and set segment $segment ':' $namespace
|
|
|
|
and set segment $segment ':' $namespace
|
|
|
|
|
|
|
|
|
|
|
|
__bobthefish_start_segment $color_k8s
|
|
|
|
__bobthefish_start_segment $color_k8s
|
|
|
|
echo -ns $segment ' '
|
|
|
|
echo -ns $segment ' '
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ==============================
|
|
|
|
# ==============================
|
|
|
|
# Cloud Tools
|
|
|
|
# Cloud Tools
|
|
|
|
# ==============================
|
|
|
|
# ==============================
|
|
|
|
|
|
|
|
|
|
|
|
function __bobthefish_prompt_aws_vault_profile -S -d 'Show AWS Vault profile'
|
|
|
|
function __bobthefish_prompt_aws_vault_profile -S -d 'Show AWS Vault profile'
|
|
|
|
[ "$theme_display_aws_vault_profile" = 'yes' ]
|
|
|
|
[ "$theme_display_aws_vault_profile" = yes ]
|
|
|
|
or return
|
|
|
|
or return
|
|
|
|
|
|
|
|
|
|
|
|
[ -n "$AWS_VAULT" -a -n "$AWS_CREDENTIAL_EXPIRATION" ]
|
|
|
|
[ -n "$AWS_VAULT" -a -n "$AWS_CREDENTIAL_EXPIRATION" ]
|
|
|
|
@@ -666,7 +662,7 @@ function __bobthefish_prompt_aws_vault_profile -S -d 'Show AWS Vault profile'
|
|
|
|
|
|
|
|
|
|
|
|
set -l diff_time $diff_mins"m"
|
|
|
|
set -l diff_time $diff_mins"m"
|
|
|
|
[ $diff_mins -le 0 ]
|
|
|
|
[ $diff_mins -le 0 ]
|
|
|
|
and set -l diff_time '0m'
|
|
|
|
and set -l diff_time 0m
|
|
|
|
[ $diff_mins -ge 60 ]
|
|
|
|
[ $diff_mins -ge 60 ]
|
|
|
|
and set -l diff_time (math "floor($diff_mins / 60)")"h"(math "$diff_mins % 60")"m"
|
|
|
|
and set -l diff_time (math "floor($diff_mins / 60)")"h"(math "$diff_mins % 60")"m"
|
|
|
|
|
|
|
|
|
|
|
|
@@ -679,7 +675,6 @@ function __bobthefish_prompt_aws_vault_profile -S -d 'Show AWS Vault profile'
|
|
|
|
echo -ns $segment ' '
|
|
|
|
echo -ns $segment ' '
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ==============================
|
|
|
|
# ==============================
|
|
|
|
# User / hostname info segments
|
|
|
|
# User / hostname info segments
|
|
|
|
# ==============================
|
|
|
|
# ==============================
|
|
|
|
@@ -696,13 +691,13 @@ if not type -q prompt_hostname
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function __bobthefish_prompt_user -S -d 'Display current user and hostname'
|
|
|
|
function __bobthefish_prompt_user -S -d 'Display current user and hostname'
|
|
|
|
[ "$theme_display_user" = 'yes' -o \( "$theme_display_user" != 'no' -a -n "$SSH_CLIENT" \) -o \( -n "$default_user" -a "$USER" != "$default_user" \) ]
|
|
|
|
[ "$theme_display_user" = yes -o \( "$theme_display_user" != no -a -n "$SSH_CLIENT" \) -o \( -n "$default_user" -a "$USER" != "$default_user" \) ]
|
|
|
|
and set -l display_user
|
|
|
|
and set -l display_user
|
|
|
|
|
|
|
|
|
|
|
|
[ "$theme_display_sudo_user" = 'yes' -a -n "$SUDO_USER" ]
|
|
|
|
[ "$theme_display_sudo_user" = yes -a -n "$SUDO_USER" ]
|
|
|
|
and set -l display_sudo_user
|
|
|
|
and set -l display_sudo_user
|
|
|
|
|
|
|
|
|
|
|
|
[ "$theme_display_hostname" = 'yes' -o \( "$theme_display_hostname" != 'no' -a -n "$SSH_CLIENT" \) ]
|
|
|
|
[ "$theme_display_hostname" = yes -o \( "$theme_display_hostname" != no -a -n "$SSH_CLIENT" \) ]
|
|
|
|
and set -l display_hostname
|
|
|
|
and set -l display_hostname
|
|
|
|
|
|
|
|
|
|
|
|
if set -q display_user
|
|
|
|
if set -q display_user
|
|
|
|
@@ -739,7 +734,6 @@ function __bobthefish_prompt_user -S -d 'Display current user and hostname'
|
|
|
|
and echo -ns ' '
|
|
|
|
and echo -ns ' '
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ==============================
|
|
|
|
# ==============================
|
|
|
|
# Virtual environment segments
|
|
|
|
# Virtual environment segments
|
|
|
|
# ==============================
|
|
|
|
# ==============================
|
|
|
|
@@ -782,14 +776,14 @@ function __bobthefish_rvm_info -S -d 'Current Ruby information from RVM'
|
|
|
|
|
|
|
|
|
|
|
|
# If interpreter differs form default interpreter, show everything:
|
|
|
|
# If interpreter differs form default interpreter, show everything:
|
|
|
|
if [ "$__rvm_default_ruby_interpreter" != "$__rvm_current_ruby_interpreter" ]
|
|
|
|
if [ "$__rvm_default_ruby_interpreter" != "$__rvm_current_ruby_interpreter" ]
|
|
|
|
if [ "$__rvm_current_ruby_gemset" = 'global' ]
|
|
|
|
if [ "$__rvm_current_ruby_gemset" = global ]
|
|
|
|
rvm-prompt i v
|
|
|
|
rvm-prompt i v
|
|
|
|
else
|
|
|
|
else
|
|
|
|
rvm-prompt i v g
|
|
|
|
rvm-prompt i v g
|
|
|
|
end
|
|
|
|
end
|
|
|
|
# If version differs form default version
|
|
|
|
# If version differs form default version
|
|
|
|
else if [ "$__rvm_default_ruby_version" != "$__rvm_current_ruby_version" ]
|
|
|
|
else if [ "$__rvm_default_ruby_version" != "$__rvm_current_ruby_version" ]
|
|
|
|
if [ "$__rvm_current_ruby_gemset" = 'global' ]
|
|
|
|
if [ "$__rvm_current_ruby_gemset" = global ]
|
|
|
|
rvm-prompt v
|
|
|
|
rvm-prompt v
|
|
|
|
else
|
|
|
|
else
|
|
|
|
rvm-prompt v g
|
|
|
|
rvm-prompt v g
|
|
|
|
@@ -801,7 +795,7 @@ function __bobthefish_rvm_info -S -d 'Current Ruby information from RVM'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function __bobthefish_prompt_rubies -S -d 'Display current Ruby information'
|
|
|
|
function __bobthefish_prompt_rubies -S -d 'Display current Ruby information'
|
|
|
|
[ "$theme_display_ruby" = 'no' ]
|
|
|
|
[ "$theme_display_ruby" = no ]
|
|
|
|
and return
|
|
|
|
and return
|
|
|
|
|
|
|
|
|
|
|
|
set -l ruby_version
|
|
|
|
set -l ruby_version
|
|
|
|
@@ -845,43 +839,43 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
function __bobthefish_prompt_golang -S -a real_pwd -d 'Display current Go information'
|
|
|
|
function __bobthefish_prompt_golang -S -a real_pwd -d 'Display current Go information'
|
|
|
|
# setting is 'no', don't display the prompt
|
|
|
|
# setting is 'no', don't display the prompt
|
|
|
|
[ "$theme_display_go" = 'no' ]
|
|
|
|
[ "$theme_display_go" = no ]
|
|
|
|
and return
|
|
|
|
and return
|
|
|
|
|
|
|
|
|
|
|
|
# find the closest go.mod
|
|
|
|
# find the closest go.mod
|
|
|
|
set -l gomod_version "0"
|
|
|
|
set -l gomod_version 0
|
|
|
|
set -l d $real_pwd
|
|
|
|
set -l d $real_pwd
|
|
|
|
while not [ -z "$d" ]
|
|
|
|
while not [ -z "$d" ]
|
|
|
|
if [ -e $d/go.mod ]
|
|
|
|
if [ -e $d/go.mod ]
|
|
|
|
string match -rq '^go\s(?<gomod_version>\S+)' < "$d/go.mod"
|
|
|
|
string match -rq '^go\s(?<gomod_version>\S+)' <"$d/go.mod"
|
|
|
|
break
|
|
|
|
break
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
[ "$d" = "/" ]
|
|
|
|
[ "$d" = / ]
|
|
|
|
and return
|
|
|
|
and return
|
|
|
|
|
|
|
|
|
|
|
|
set d (__bobthefish_dirname $d)
|
|
|
|
set d (__bobthefish_dirname $d)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# no go.mod, not in a go project, don't display the prompt
|
|
|
|
# no go.mod, not in a go project, don't display the prompt
|
|
|
|
if [ "$gomod_version" = "0" ]
|
|
|
|
if [ "$gomod_version" = 0 ]
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# check if there's a Go executable
|
|
|
|
# check if there's a Go executable
|
|
|
|
set -l no_go_installed "0"
|
|
|
|
set -l no_go_installed 0
|
|
|
|
set -l actual_go_version "0"
|
|
|
|
set -l actual_go_version 0
|
|
|
|
set -l high_enough_version "0"
|
|
|
|
set -l high_enough_version 0
|
|
|
|
if command -q go
|
|
|
|
if command -q go
|
|
|
|
set actual_go_version (go version | string replace --filter -r 'go version go(\\d+\\.\\d+(?:\\.\\d+)?).*' '$1')
|
|
|
|
set actual_go_version (go version | string replace --filter -r 'go version go(\\d+\\.\\d+(?:\\.\\d+)?).*' '$1')
|
|
|
|
if printf "%s\n%s" "$gomod_version" "$actual_go_version" | sort --check=silent --version-sort
|
|
|
|
if printf "%s\n%s" "$gomod_version" "$actual_go_version" | sort --check=silent --version-sort
|
|
|
|
set high_enough_version "1"
|
|
|
|
set high_enough_version 1
|
|
|
|
end
|
|
|
|
end
|
|
|
|
else
|
|
|
|
else
|
|
|
|
set no_go_installed "1"
|
|
|
|
set no_go_installed 1
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$high_enough_version" = "1" ]
|
|
|
|
if [ "$high_enough_version" = 1 ]
|
|
|
|
__bobthefish_start_segment $color_virtualgo
|
|
|
|
__bobthefish_start_segment $color_virtualgo
|
|
|
|
else
|
|
|
|
else
|
|
|
|
__bobthefish_start_segment $color_rvm
|
|
|
|
__bobthefish_start_segment $color_rvm
|
|
|
|
@@ -891,8 +885,8 @@ function __bobthefish_prompt_golang -S -a real_pwd -d 'Display current Go inform
|
|
|
|
echo -ns "$gomod_version "
|
|
|
|
echo -ns "$gomod_version "
|
|
|
|
|
|
|
|
|
|
|
|
# showing the prompt -- but plain ( for 'yes' ) or verbose?
|
|
|
|
# showing the prompt -- but plain ( for 'yes' ) or verbose?
|
|
|
|
if [ "$theme_display_go" = "verbose" ]
|
|
|
|
if [ "$theme_display_go" = verbose ]
|
|
|
|
if [ "$actual_go_version" != "0" ]
|
|
|
|
if [ "$actual_go_version" != 0 ]
|
|
|
|
# show the prompt with the required version AND the currently available
|
|
|
|
# show the prompt with the required version AND the currently available
|
|
|
|
# version; same color rules as above
|
|
|
|
# version; same color rules as above
|
|
|
|
echo -ns " ($actual_go_version)"
|
|
|
|
echo -ns " ($actual_go_version)"
|
|
|
|
@@ -917,21 +911,21 @@ function __bobthefish_prompt_virtualfish -S -d "Display current Python virtual e
|
|
|
|
command -q python
|
|
|
|
command -q python
|
|
|
|
or return
|
|
|
|
or return
|
|
|
|
|
|
|
|
|
|
|
|
[ "$theme_display_virtualenv" = 'no' -o -z "$VIRTUAL_ENV" -a -z "$CONDA_DEFAULT_ENV" ]
|
|
|
|
[ "$theme_display_virtualenv" = no -o -z "$VIRTUAL_ENV" -a -z "$CONDA_DEFAULT_ENV" ]
|
|
|
|
and return
|
|
|
|
and return
|
|
|
|
|
|
|
|
|
|
|
|
set -l version_glyph (__bobthefish_virtualenv_python_version)
|
|
|
|
set -l version_glyph (__bobthefish_virtualenv_python_version)
|
|
|
|
set -l prompt_style 'default'
|
|
|
|
set -l prompt_style default
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$version_glyph" ]
|
|
|
|
if [ "$version_glyph" ]
|
|
|
|
__bobthefish_start_segment $color_virtualfish
|
|
|
|
__bobthefish_start_segment $color_virtualfish
|
|
|
|
if string match -q "Python 2*" (python --version 2>&1 | string trim)
|
|
|
|
if string match -q "Python 2*" (python --version 2>&1 | string trim)
|
|
|
|
set prompt_style 'verbose'
|
|
|
|
set prompt_style verbose
|
|
|
|
else if [ "$theme_display_virtualenv" = 'verbose' ]
|
|
|
|
else if [ "$theme_display_virtualenv" = verbose ]
|
|
|
|
set prompt_style 'verbose'
|
|
|
|
set prompt_style verbose
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$prompt_style" = 'verbose' ]
|
|
|
|
if [ "$prompt_style" = verbose ]
|
|
|
|
echo -ns $virtualenv_glyph $version_glyph ' '
|
|
|
|
echo -ns $virtualenv_glyph $version_glyph ' '
|
|
|
|
else
|
|
|
|
else
|
|
|
|
echo -ns $virtualenv_glyph
|
|
|
|
echo -ns $virtualenv_glyph
|
|
|
|
@@ -947,7 +941,7 @@ function __bobthefish_prompt_virtualfish -S -d "Display current Python virtual e
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function __bobthefish_prompt_virtualgo -S -d 'Display current Go virtual environment'
|
|
|
|
function __bobthefish_prompt_virtualgo -S -d 'Display current Go virtual environment'
|
|
|
|
[ "$theme_display_virtualgo" = 'no' -o -z "$VIRTUALGO" ]
|
|
|
|
[ "$theme_display_virtualgo" = no -o -z "$VIRTUALGO" ]
|
|
|
|
and return
|
|
|
|
and return
|
|
|
|
|
|
|
|
|
|
|
|
__bobthefish_start_segment $color_virtualgo
|
|
|
|
__bobthefish_start_segment $color_virtualgo
|
|
|
|
@@ -956,7 +950,7 @@ function __bobthefish_prompt_virtualgo -S -d 'Display current Go virtual environ
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function __bobthefish_prompt_desk -S -d 'Display current desk environment'
|
|
|
|
function __bobthefish_prompt_desk -S -d 'Display current desk environment'
|
|
|
|
[ "$theme_display_desk" = 'no' -o -z "$DESK_ENV" ]
|
|
|
|
[ "$theme_display_desk" = no -o -z "$DESK_ENV" ]
|
|
|
|
and return
|
|
|
|
and return
|
|
|
|
|
|
|
|
|
|
|
|
__bobthefish_start_segment $color_desk
|
|
|
|
__bobthefish_start_segment $color_desk
|
|
|
|
@@ -980,7 +974,7 @@ function __bobthefish_prompt_find_file_up -S -d 'Find file(s), going up the pare
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
[ "$dir" = '/' ]
|
|
|
|
[ "$dir" = / ]
|
|
|
|
and return 1
|
|
|
|
and return 1
|
|
|
|
|
|
|
|
|
|
|
|
set dir (__bobthefish_dirname "$dir")
|
|
|
|
set dir (__bobthefish_dirname "$dir")
|
|
|
|
@@ -991,9 +985,9 @@ end
|
|
|
|
function __bobthefish_prompt_node -S -d 'Display current node version'
|
|
|
|
function __bobthefish_prompt_node -S -d 'Display current node version'
|
|
|
|
set -l should_show
|
|
|
|
set -l should_show
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$theme_display_node" = 'always' -o "$theme_display_nvm" = 'yes' ]
|
|
|
|
if [ "$theme_display_node" = always -o "$theme_display_nvm" = yes ]
|
|
|
|
set should_show 1
|
|
|
|
set should_show 1
|
|
|
|
else if [ "$theme_display_node" = 'yes' ]
|
|
|
|
else if [ "$theme_display_node" = yes ]
|
|
|
|
__bobthefish_prompt_find_file_up "$PWD" package.json .nvmrc .node-version
|
|
|
|
__bobthefish_prompt_find_file_up "$PWD" package.json .nvmrc .node-version
|
|
|
|
and set should_show 1
|
|
|
|
and set should_show 1
|
|
|
|
end
|
|
|
|
end
|
|
|
|
@@ -1005,10 +999,10 @@ function __bobthefish_prompt_node -S -d 'Display current node version'
|
|
|
|
set -l node_manager_dir
|
|
|
|
set -l node_manager_dir
|
|
|
|
|
|
|
|
|
|
|
|
if type -q nvm
|
|
|
|
if type -q nvm
|
|
|
|
set node_manager 'nvm'
|
|
|
|
set node_manager nvm
|
|
|
|
set node_manager_dir $NVM_DIR
|
|
|
|
set node_manager_dir $NVM_DIR
|
|
|
|
else if command -q fnm
|
|
|
|
else if command -q fnm
|
|
|
|
set node_manager 'fnm'
|
|
|
|
set node_manager fnm
|
|
|
|
set node_manager_dir $FNM_DIR
|
|
|
|
set node_manager_dir $FNM_DIR
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1017,7 +1011,7 @@ function __bobthefish_prompt_node -S -d 'Display current node version'
|
|
|
|
|
|
|
|
|
|
|
|
set -l node_version ("$node_manager" current 2> /dev/null)
|
|
|
|
set -l node_version ("$node_manager" current 2> /dev/null)
|
|
|
|
|
|
|
|
|
|
|
|
[ -z $node_version -o "$node_version" = 'none' -o "$node_version" = 'system' ]
|
|
|
|
[ -z $node_version -o "$node_version" = none -o "$node_version" = system ]
|
|
|
|
and return
|
|
|
|
and return
|
|
|
|
|
|
|
|
|
|
|
|
[ -n "$color_nvm" ]
|
|
|
|
[ -n "$color_nvm" ]
|
|
|
|
@@ -1029,7 +1023,7 @@ function __bobthefish_prompt_node -S -d 'Display current node version'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function __bobthefish_prompt_nix -S -d 'Display current nix environment'
|
|
|
|
function __bobthefish_prompt_nix -S -d 'Display current nix environment'
|
|
|
|
[ "$theme_display_nix" = 'no' -o -z "$IN_NIX_SHELL" ]
|
|
|
|
[ "$theme_display_nix" = no -o -z "$IN_NIX_SHELL" ]
|
|
|
|
and return
|
|
|
|
and return
|
|
|
|
|
|
|
|
|
|
|
|
__bobthefish_start_segment $color_nix
|
|
|
|
__bobthefish_start_segment $color_nix
|
|
|
|
@@ -1123,7 +1117,7 @@ function __bobthefish_prompt_hg -S -a hg_root_dir -a real_pwd -d 'Display the ac
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function __bobthefish_prompt_screen -S -d 'Display the screen name'
|
|
|
|
function __bobthefish_prompt_screen -S -d 'Display the screen name'
|
|
|
|
[ "$theme_display_screen" = 'no' -o -z "$STY" ]
|
|
|
|
[ "$theme_display_screen" = no -o -z "$STY" ]
|
|
|
|
and return
|
|
|
|
and return
|
|
|
|
|
|
|
|
|
|
|
|
__bobthefish_start_segment $color_screen
|
|
|
|
__bobthefish_start_segment $color_screen
|
|
|
|
@@ -1133,11 +1127,11 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
function __bobthefish_prompt_git -S -a git_root_dir -a real_pwd -d 'Display the actual git state'
|
|
|
|
function __bobthefish_prompt_git -S -a git_root_dir -a real_pwd -d 'Display the actual git state'
|
|
|
|
set -l dirty ''
|
|
|
|
set -l dirty ''
|
|
|
|
if [ "$theme_display_git_dirty" != 'no' ]
|
|
|
|
if [ "$theme_display_git_dirty" != no ]
|
|
|
|
set -l show_dirty (command git config --bool bash.showDirtyState 2>/dev/null)
|
|
|
|
set -l show_dirty (command git config --bool bash.showDirtyState 2>/dev/null)
|
|
|
|
if [ "$show_dirty" != 'false' ]
|
|
|
|
if [ "$show_dirty" != false ]
|
|
|
|
set dirty (command git diff --no-ext-diff --quiet --exit-code 2>/dev/null; or echo -n "$git_dirty_glyph")
|
|
|
|
set dirty (command git diff --no-ext-diff --quiet --exit-code 2>/dev/null; or echo -n "$git_dirty_glyph")
|
|
|
|
if [ "$dirty" -a "$theme_display_git_dirty_verbose" = 'yes' ]
|
|
|
|
if [ "$dirty" -a "$theme_display_git_dirty_verbose" = yes ]
|
|
|
|
set dirty "$dirty"(__bobthefish_git_dirty_verbose)
|
|
|
|
set dirty "$dirty"(__bobthefish_git_dirty_verbose)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
@@ -1148,9 +1142,9 @@ function __bobthefish_prompt_git -S -a git_root_dir -a real_pwd -d 'Display the
|
|
|
|
set -l ahead (__bobthefish_git_ahead)
|
|
|
|
set -l ahead (__bobthefish_git_ahead)
|
|
|
|
|
|
|
|
|
|
|
|
set -l new ''
|
|
|
|
set -l new ''
|
|
|
|
if [ "$theme_display_git_untracked" != 'no' ]
|
|
|
|
if [ "$theme_display_git_untracked" != no ]
|
|
|
|
set -l show_untracked (command git config --bool bash.showUntrackedFiles 2>/dev/null)
|
|
|
|
set -l show_untracked (command git config --bool bash.showUntrackedFiles 2>/dev/null)
|
|
|
|
if [ "$show_untracked" != 'false' ]
|
|
|
|
if [ "$show_untracked" != false ]
|
|
|
|
set new (command git ls-files --other --exclude-standard --directory --no-empty-directory "$git_root_dir" 2>/dev/null)
|
|
|
|
set new (command git ls-files --other --exclude-standard --directory --no-empty-directory "$git_root_dir" 2>/dev/null)
|
|
|
|
if [ "$new" ]
|
|
|
|
if [ "$new" ]
|
|
|
|
set new "$git_untracked_glyph"
|
|
|
|
set new "$git_untracked_glyph"
|
|
|
|
@@ -1176,7 +1170,7 @@ function __bobthefish_prompt_git -S -a git_root_dir -a real_pwd -d 'Display the
|
|
|
|
echo -ns (__bobthefish_git_branch) $flags ' '
|
|
|
|
echo -ns (__bobthefish_git_branch) $flags ' '
|
|
|
|
set_color normal
|
|
|
|
set_color normal
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$theme_git_worktree_support" != 'yes' ]
|
|
|
|
if [ "$theme_git_worktree_support" != yes ]
|
|
|
|
set -l project_pwd (__bobthefish_project_pwd $git_root_dir $real_pwd)
|
|
|
|
set -l project_pwd (__bobthefish_project_pwd $git_root_dir $real_pwd)
|
|
|
|
if [ "$project_pwd" ]
|
|
|
|
if [ "$project_pwd" ]
|
|
|
|
if [ -w "$real_pwd" ]
|
|
|
|
if [ -w "$real_pwd" ]
|
|
|
|
@@ -1226,7 +1220,7 @@ function __bobthefish_prompt_git -S -a git_root_dir -a real_pwd -d 'Display the
|
|
|
|
set_color normal
|
|
|
|
set_color normal
|
|
|
|
set_color -b $colors
|
|
|
|
set_color -b $colors
|
|
|
|
[ "$project_pwd" ]
|
|
|
|
[ "$project_pwd" ]
|
|
|
|
and echo -n '/'
|
|
|
|
and echo -n /
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
echo -ns $project_pwd ' '
|
|
|
|
echo -ns $project_pwd ' '
|
|
|
|
@@ -1264,7 +1258,6 @@ function __bobthefish_closest_parent -S
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ==============================
|
|
|
|
# ==============================
|
|
|
|
# Apply theme
|
|
|
|
# Apply theme
|
|
|
|
# ==============================
|
|
|
|
# ==============================
|
|
|
|
@@ -1274,7 +1267,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome'
|
|
|
|
set -l last_status $status
|
|
|
|
set -l last_status $status
|
|
|
|
|
|
|
|
|
|
|
|
# Use a simple prompt on dumb terminals.
|
|
|
|
# Use a simple prompt on dumb terminals.
|
|
|
|
if [ "$TERM" = 'dumb' ]
|
|
|
|
if [ "$TERM" = dumb ]
|
|
|
|
echo '> '
|
|
|
|
echo '> '
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
@@ -1316,7 +1309,6 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome'
|
|
|
|
__bobthefish_prompt_virtualgo
|
|
|
|
__bobthefish_prompt_virtualgo
|
|
|
|
__bobthefish_prompt_node
|
|
|
|
__bobthefish_prompt_node
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# VCS
|
|
|
|
# VCS
|
|
|
|
set -l git_root_dir (__bobthefish_git_project_dir $real_pwd)
|
|
|
|
set -l git_root_dir (__bobthefish_git_project_dir $real_pwd)
|
|
|
|
set -l hg_root_dir (__bobthefish_hg_project_dir $real_pwd)
|
|
|
|
set -l hg_root_dir (__bobthefish_hg_project_dir $real_pwd)
|
|
|
|
|