Autocomplete fails while using zsh.
See original GitHub issueBug report
Required Info:
- Operating System:
- Ubuntu 18.04
- Installation type:
- binaries
- Version or commit hash:
- Dashing / Eloquent
- DDS implementation:
- ALL
- Client library (if applicable):
- N/A
Steps to reproduce issue
I use zsh as my shell, but I find some problems while using <tab>
to autocomplete.
- While I type
ros2 run <tab>
, it works well. - However when I type
ros2 run d<tab>
, it can’t show the packages which starts with ‘d’.
Additional information
After some debugging, I find that the behavior is related to argcomplete library in Python 3.
If I remove the library rm -rf ~/.local/lib/python3.6/site-packages/argcomplete*
, zsh works well again.
I’m not pretty sure what the root cause is.
Maybe argcomplete library does not support zsh well.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:26 (9 by maintainers)
Top Results From Across the Web
Autocompletion not working for pass password manager in ...
If completions in zsh are not working then the pass.zsh-completion file is not in the right place or on the (right) path.
Read more >shell - Zsh tab-completion not working - Stack Overflow
Hello, after switching from Bash to Zsh on macOS Catalina, Tab completion stopped working for me. Apparently it is working in directories where ......
Read more >Pass autocomplete only works directly after installing oh-my-zsh
If I close and re-open the terminal, auto-complete no longer works. I'm running MacOS BigSur M1. I'm using the Unix Pass manager, which...
Read more >2055162 – Autocompletion broken in zsh-5.8.1
I guess this was caused by updating the zsh package from 5.8 to 5.8.1 while zsh was running. The following command (or opening...
Read more >zsh auto-completion - Kubernetes
After reloading your shell, kubectl autocompletion should be working. If you get an error like 2: command not found: compdef , then add...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Having the same issue with Zsh and ROS2 Galactic too.
But I found a solution in https://kislyuk.github.io/argcomplete/#zsh-support
By adding these lines to
.zshrc
the argcompletion is succesfully enabled.(Thanks to https://github.com/ros2/ros2cli/issues/534#issuecomment-957905035, I removed the unnessecary
autoload -U bashcompinit \ bashcompinit
)Instead of running
eval "$(register-python-argcomplete3 ros2)"
every time after sourcingsetup.zsh
, I made a modification in/opt/ros/galactic/share/rosidl_cli/environment/rosidl-argcomplete.zsh
. I removed/commented the line:Then
ros2
tab completion works. This has to do withcompinit
being called too many times (see also https://stackoverflow.com/questions/67136714/how-to-properly-call-compinit-and-bashcompinit-in-zsh ).I’m not sure what a final fix should be, especially since tab completion for
colcon
still doesn’t work with this change (theeval "$(register-python-argcomplete3 colcon)"
is still needed for that).