mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 04:39:39 +08:00
sample_prompts/acidhub: Use prompt_pwd
This removes a call to `sed` and allows the user to specify shortening via the variable. We still default to disabling shortening because this prompt never did. [ci skip]
This commit is contained in:
parent
9910ee26cd
commit
f637b81fb6
@ -38,8 +38,12 @@ function fish_prompt -d "Write out the prompt"
|
||||
set git_info "(git$git_status$git_branch"(set_color white)")"
|
||||
end
|
||||
|
||||
# Disable PWD shortening by default.
|
||||
set -q fish_prompt_pwd_dir_length
|
||||
or set -lx fish_prompt_pwd_dir_length 0
|
||||
|
||||
set_color -b black
|
||||
printf '%s%s%s%s%s%s%s%s%s%s%s%s%s' (set_color -o white) '❰' (set_color green) $USER (set_color white) '❙' (set_color yellow) (echo $PWD | sed -e "s|^$HOME|~|") (set_color white) $git_info (set_color white) '❱' (set_color white)
|
||||
printf '%s%s%s%s%s%s%s%s%s%s%s%s%s' (set_color -o white) '❰' (set_color green) $USER (set_color white) '❙' (set_color yellow) (prompt_pwd) (set_color white) $git_info (set_color white) '❱' (set_color white)
|
||||
if test $laststatus -eq 0
|
||||
printf "%s✔%s≻%s " (set_color -o green) (set_color white) (set_color normal)
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user