mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-19 18:22:45 +08:00
cdh: Only replace home directory with ~ at the start of paths
This commit is contained in:
parent
fa66ac8d8c
commit
c79db8ecf7
|
@ -54,7 +54,7 @@ function cdh --description "Menu based cd command"
|
|||
set dir_color (set_color $fish_color_history_current)
|
||||
end
|
||||
|
||||
set -l home_dir (string match -r "$HOME(/.*|\$)" "$dir")
|
||||
set -l home_dir (string match -r "^$HOME(/.*|\$)" "$dir")
|
||||
if set -q home_dir[2]
|
||||
set dir "~$home_dir[2]"
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user