rosidl icon indicating copy to clipboard operation
rosidl copied to clipboard

to support complete for rosidl and avoid calling multiple compinit

Open iuhilnehc-ynos opened this issue 3 years ago • 3 comments

Signed-off-by: Chen Lihui [email protected]

iuhilnehc-ynos avatar Aug 15 '22 05:08 iuhilnehc-ynos

to fix https://github.com/ros2/ros2_documentation/issues/2944

iuhilnehc-ynos avatar Aug 15 '22 05:08 iuhilnehc-ynos

Cross-ref https://github.com/ros2/ros2cli/issues/534

mjbogusz avatar Aug 22 '22 10:08 mjbogusz

If I understand correctly, this solution relies on checking whether functions compdef and complete exists and assumes that if so, then they must have been called. This MIGHT conflict with other systems/scripts that either utilize completion or define functions with such names. For example I have NVM installed (note: the nvm script merely calls bashcompinit):

$ type compdef
compdef is a shell function from /usr/share/zsh/functions/Completion/compinit
$ type complete
complete is a shell function from /home/mjbogusz/.nvm/bash_completion

Note however that this might not be a problem at all, I'm just documenting my observations.

mjbogusz avatar Jan 17 '23 13:01 mjbogusz