fish: Fix escaping of ~ in trim_trailing_slashes
parent
3e2691b0d3
commit
b8794f4f1a
|
@ -4,7 +4,14 @@ function trim_trailing_slashes --description "Trim trailing slashes of all comma
|
|||
set -l list (commandline -o)
|
||||
commandline -r ""
|
||||
for i in $list
|
||||
commandline -i -- (string escape (string replace -r '/$' '' $i))
|
||||
set i (string replace -r '/$' '' $i)
|
||||
set -l prefix (string sub -s 1 -l 1 -- $i)
|
||||
switch $prefix
|
||||
case '~'
|
||||
commandline -t -- (string sub -s 2 (string escape -n -- $i))
|
||||
case '*'
|
||||
commandline -t -- (string escape -- $i)
|
||||
end
|
||||
commandline -i -- ' '
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue