mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-04 07:21:14 -03:00
Use path basename instead of basename
This is faster and guaranteed to be available
This commit is contained in:
@@ -76,7 +76,7 @@ function fish_prompt
|
||||
set arrow "$arrow_color# "
|
||||
end
|
||||
|
||||
set -l cwd $cyan(basename (prompt_pwd))
|
||||
set -l cwd $cyan(prompt_pwd | path basename)
|
||||
|
||||
set -l repo_info
|
||||
if set -l repo_type (_repo_type)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
function fish_prompt
|
||||
set_color $fish_color_cwd
|
||||
echo -n (basename $PWD)
|
||||
echo -n (path basename $PWD)
|
||||
set_color normal
|
||||
echo -n ' ) '
|
||||
end
|
||||
|
||||
@@ -109,7 +109,7 @@ function fish_prompt
|
||||
set -q VIRTUAL_ENV_DISABLE_PROMPT
|
||||
or set -g VIRTUAL_ENV_DISABLE_PROMPT true
|
||||
set -q VIRTUAL_ENV
|
||||
and _nim_prompt_wrapper $retc V (basename "$VIRTUAL_ENV")
|
||||
and _nim_prompt_wrapper $retc V (path basename "$VIRTUAL_ENV")
|
||||
|
||||
# git
|
||||
set -l prompt_git (fish_git_prompt '%s')
|
||||
|
||||
@@ -23,7 +23,7 @@ function fish_prompt
|
||||
# Line 2
|
||||
echo
|
||||
if test -n "$VIRTUAL_ENV"
|
||||
printf "(%s) " (set_color blue)(basename $VIRTUAL_ENV)(set_color normal)
|
||||
printf "(%s) " (set_color blue)(path basename $VIRTUAL_ENV)(set_color normal)
|
||||
end
|
||||
printf '↪ '
|
||||
set_color normal
|
||||
|
||||
Reference in New Issue
Block a user