-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
cd text TAB to autocomplete fails for dir with spaces (Linux) #549
Comments
Thanks for the report. I tried it in Fedora 41, but the problem doesn't reproduce with
I also tried the following combinations, but none reproduced the problem.
I also tried turning off auto-complete (
$ complete -p cd
$ type _fzf_handle_dynamic_completion
$ declare -p _fzf_orig_completion_cd (These are the results in my environment)Without fzf $ complete -p cd
complete -o filenames -F __zoxide_z_complete cd
$ type _fzf_handle_dynamic_completion
bash-5.2: type: _fzf_handle_dynamic_completion: not found
[ble: exit 1]
$ declare -p _fzf_orig_completion_cd
bash-5.2: declare: _fzf_orig_completion_cd: not found
[ble: exit 1]
$ With fzf $ complete -p cd
complete -o filenames -F _fzf_dir_completion cd
$ type _fzf_handle_dynamic_completion
_fzf_handle_dynamic_completion is a function
_fzf_handle_dynamic_completion ()
{
ble/function#advice/.proc "$FUNCNAME" "$@"
}
$ declare -p _fzf_orig_completion_cd
declare -- _fzf_orig_completion_cd="complete -o filenames -F %s cd #__zoxide_z_complete"
$
|
Thanka for the reply.
Tomorrow I'll minimize the config and also try to figure out why the last command returns an error. The output on macOS is Strange thing is that I am using the same setup. I am using dotbot. I do have a few macOS specific configs (aliases, path, gpg pinentry), but not when it comes to setting up ble, zoxide, starship, fzf, completion, and atuin. Weird. |
Ah, sorry. I forgot to tell you that one needs to run |
Same result, even after attempting the auto complete. I'm about to fall asleep. I'm way past my bed time. ;-) ttyl. And thanks again for looking into this. I'm gonna do more debugging tomorrow and I'll get you a minimal .bashrc. |
Thanks! Good night! |
I found the issue, even though it is rather weird, since I made changes to this provided by you for an earlier issue. And it works on macOS, so that's even stranger. Usually things work on Linux and have to be adjusted for macOS. If I source this file in https://evermeet.cx/paste/fzf.7qs6.sh Here is the other file that is sourced from within that file: https://evermeet.cx/paste/fzf_git.W66w.sh (The files will be available for 7 days.) As you can see I made the changes you provided for ble and fzf. P.S.: I have created a VM that shows that problem. If you want access, please let me know. In that case I'll send the connect info via email. |
Thanks. I now tried your files, but I still cannot reproduce the problem.
What is the content of
Thanks. I've already copied the file in my development machine, so you can remove those files now (if it is possible and you'd like to do it).
OK, it works for me. Thank you. |
I could minimize the setup in your environment: # ~/.bashrc
. /etc/profile.d/bash_completion.sh
. ~/.local/share/blesh/ble.sh
ble-import -d integration/fzf-completion
eval "$(zoxide init --cmd cd bash)" Then, I realized that the version of |
Thanks for the info. Does this mean it's an upstream issue? e.g. I guess the bash completion on macOS is also different. |
I further reduced the setup. It was actually unrelated to the version of bash-completion, but how the bash-completion was sourced. The system bash-completion tries to source # bashrc
source /path/to/ble.sh --norc
source /etc/bash_completion.d/fzf
ble-import -d integration/fzf-completion
eval "$(zoxide init --cmd cd bash)"
|
I could even simplify the reproducer as follows. The key was dropping # bashrc
source /path/to/ble.sh --norc
ble-import integration/fzf-completion
eval "$(zoxide init --cmd cd bash)" I'll later look closer at it. |
Interesting, so it seems that Weird though that I am the first one who encountered this. fzf and zoxide are quite common these days. Thanks again for looking into this. |
I fixed it in commit akinomyoga/blesh-contrib@a5d3a2e. This was an issue with the zoxide integration (which is automatically loaded) and was actually identical to the problem reported for |
Thanks for the info. I am still a bit confused why this only seemed to be triggering an issue on Linux. (Or maybe anything but macOS.) |
Updated ble on macOS and Linux. macOS still works and Linux works now as well! 🎉 Thanks! |
I'm not sure what causes this difference. If something would affect, it could be an initialization ordering of completion settings, but as far as you use the same setup with the same versions of Bash, ble.sh, bash-completion, etc., the initialization ordering should be identical and the behavior should be the same. Do you think it would be another issue? Should we identify the cause of this difference? |
Right now it makes no sense, since the bash init is identical except for minor changes (different aliases and such). I am happy that it works, but it is certainly strange that it worked on macOS even before your fix akinomyoga/blesh-contrib@a5d3a2e |
zoxide 0.9.6
I'm using zoxide on my Linux VM, initialized as follows in my
.bashrc
:Steps te reproduce:
mkdir -p "tmp/multiple spaces in dir"
cd tmp/mul<TAB>
Result:
zox1.mp4
Expected result:
On macOS, I get the expected result. The dir returned from the TAB autocomplete is quoted with single quotes, iff the dir contains spaces. On Linux, the TAB autocomplete does not have the single quotes, thus changing into that dir fails.
If I deactivate ble, I get:
cd tmp/multiple\ spaces\ in\ dir/
.If ble is activated and zoxide deactivated, I get:
cd 'tmp/multiple spaces in dir'/
Apparently the combinsation of zoxide and ble does not work. On Linux that is. On macOS it works just fine.
The text was updated successfully, but these errors were encountered: