mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-04 07:21:14 -03:00
prompt_pwd: Escape $HOME
This is used with a regex, so if it contained any metacharacters they'd be used.
This commit is contained in:
@@ -26,7 +26,7 @@ function prompt_pwd --description 'short CWD for the prompt'
|
||||
|
||||
for path in $argv
|
||||
# Replace $HOME with "~"
|
||||
set -l realhome ~
|
||||
set -l realhome (string escape --style=regex -- ~)
|
||||
set -l tmp (string replace -r '^'"$realhome"'($|/)' '~$1' $path)
|
||||
|
||||
if test "$fish_prompt_pwd_dir_length" -eq 0
|
||||
|
||||
Reference in New Issue
Block a user