fix: fish prompt in root directory
parent
8249bb9528
commit
098cb102d4
|
@ -18,8 +18,16 @@ end
|
|||
# Current working directory prompt
|
||||
function fish_cwd_prompt
|
||||
set -l cwd (pwd)
|
||||
test $cwd = $HOME && printf "~" || \
|
||||
printf "%s/%s" (basename (dirname $cwd)) (basename $cwd)
|
||||
switch "$cwd"
|
||||
case "$HOME"
|
||||
printf "~"
|
||||
case "/"
|
||||
printf "/"
|
||||
case "*"
|
||||
set -l parent_dir (basename (dirname $cwd))
|
||||
test $parent_dir = "/" || printf "%s" $parent_dir
|
||||
printf '/%s' (basename $cwd)
|
||||
end
|
||||
end
|
||||
|
||||
# Guix environment prompt
|
||||
|
|
Loading…
Reference in New Issue