ros2_documentation icon indicating copy to clipboard operation
ros2_documentation copied to clipboard

Autocompletion in zsh failes

Open Fildo7525 opened this issue 2 years ago • 5 comments

When I used ros2 Foxy on Ubuntu 20.04 in zsh everything was ok. Now I changed to Ubuntu 22.04 and to Humble and the autocompletion is not working for ros2

Fildo7525 avatar Aug 13 '22 14:08 Fildo7525

Same issue?: https://github.com/ros2/ros2cli/issues/534

However, for me Foxy/Galactic on 20.04 is spotty at best as well

mjbogusz avatar Aug 22 '22 09:08 mjbogusz

Same issue?: ros2/ros2cli#534

However, for me Foxy/Galactic on 20.04 is spotty at best as well

I had the same issue that the current ticket describes (env: Ubuntu 22.04+Humble) and the solution came from the issue referenced by @mjbogusz. Thanks!

Solution/workaround by @chenjunn-s comment: ros2cli/issues/534#issuecomment-957516107

By adding these lines to .zshrc the argcompletion is succesfully enabled.

# argcomplete for ros2 & colcon
eval "$(register-python-argcomplete3 ros2)"
eval "$(register-python-argcomplete3 colcon)"

Note: If the registration fails, check whether your python environment has the argcomplete package installed.

endrelaszlo avatar Dec 24 '22 23:12 endrelaszlo

@Fildo7525 @endrelaszlo @mjbogusz either of you guys, would you mind if trying https://github.com/ros2/rosidl/pull/702 to see if the problem can be solved?

fujitatomoya avatar Jan 15 '23 00:01 fujitatomoya

endrelaszlo your comment (https://github.com/endrelaszlo) worked. The only thing I would add is to put this lines before sourcing ros.

Fildo7525 avatar Jan 15 '23 10:01 Fildo7525

endrelaszlo your comment (https://github.com/endrelaszlo) worked. The only thing I would add is to put this lines before sourcing ros.

It also worked for me (Ubuntu 22.04 / Rolling), but only if I put it after sourcing ROS. So if somebody else runs into this issue, maybe try both options 🤷

SammyRamone avatar Apr 12 '23 14:04 SammyRamone