diff --git a/templates/fish.txt b/templates/fish.txt index 6d3ed4f..5ecacf8 100644 --- a/templates/fish.txt +++ b/templates/fish.txt @@ -72,7 +72,12 @@ function __zoxide_z else if test $argc -eq 1 -a -d $argv[1] __zoxide_cd $argv[1] else - set -l result (command zoxide query --exclude (__zoxide_pwd) -- $argv) + if string match '*#*' $argv &>/dev/null + set target (string match '*#*' $argv | string replace \# '') + else + set target $argv + end + set -l result (command zoxide query --exclude (__zoxide_pwd) -- $target) and __zoxide_cd $result end end @@ -89,7 +94,7 @@ function __zoxide_z_complete # If the last argument is empty, use interactive selection. set -l query $tokens[2..-1] set -l result (zoxide query -i -- $query) - and commandline --current-process "$tokens[1] "(string escape $result) + and echo \#(string escape $result) commandline --function repaint end end