-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(fish): handle dash in fzf key bindings #3928
Conversation
Thanks, but I think zoxide should fix the bug. It's not ideal that we have to maintain extra code for a minor bug in another project. |
I see, I saw your comment earlier1, but I thought the code change was so small it might go through. Do you still want to remove the Footnotes |
We should remove it. It would be ideal if we could directly call "the wrapper function" of fish, but it doesn't seem possible because it's just named https://github.com/fish-shell/fish-shell/blob/master/share/functions/cd.fish |
The patch looks okay. But I'm saying that we first need to check if there's a good reason why zoxide cannot handle |
I think I've got it. Recently, a user fixed the issue for Below, is a comparision between the latest release vs building from source, the latter succeeds when using # install zoxide
brew install zoxide
# Start a minimal bash session
command env -i HOME=$HOME TERM=$TERM USER=$USER PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin /usr/local/bin/bash --norc --noprofile
# init zoxide with the 'cd' command
eval "$(zoxide init --cmd cd bash)"
# notice it fails
cd -- /tmp
# zoxide: no match found git clone https://github.com/ajeetdsouza/zoxide
cd zoxide
cargo build --release
# start a bash session with the path for zoxide binary build at the beginning
command env -i HOME=$HOME TERM=$TERM USER=$USER PATH=/Users/paria/Developer/zoxide/target/release:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin /usr/local/bin/bash --norc --noprofile
# init zoxide with the 'cd' command
eval "$(zoxide init --cmd cd bash)"
# notice it succeeds
cd -- /tmp
pwd
# /tmp If one were to alter the --- a/templates/fish.txt
+++ b/templates/fish.txt
@@ -83,4 +83,6 @@ function __zoxide_z
else if test $argc -eq 1 -a -d $argv[1]
__zoxide_cd $argv[1]
+ else if test $argc -eq 2 -a "$argv[1]" = '--'
+ __zoxide_cd $argv[2]
else if set -l result (string replace --regex -- $__zoxide_z_prefix_regex '' $argv[-1]); and test -n $result
__zoxide_cd $result Footnotes |
Since the issue is with Do you agree? |
Yes, I agree. |
Looking at the fish code of zoxide, I'm pretty certain it's going to be trivial to fix it for anyone using fish. Not sure why no one has tried yet. |
Thank you! |
🧐 Sorry @Undefined01, the |
That's OK. I don't expect the story has happened before and we just repeat it again. Thanks for all your efforts. |
Thanks for fixing it in the |
description
Unfortuantely, we can't use the safe
cd -- …
syntax as there is a small bug inzoxide
.Therefore, a check for a leading dash has been added, and the prepended
builtin
command has been removed.Thanks to @harkabeeparolus for the investigation.