Skip to content

Add support for zsh (installed with minor modifications) #41

@olamarre

Description

@olamarre

I use zsh and was able to install this package with very little modifications to the source code. Steps to reproduce:

  • System details (running in a docker container): ROS 2 Humble in Ubuntu 22.04 with the OS' default Python 3.10
  • Install this package: sudo pip3 install ros-command
  • Replace the following line in ros_command_setup.bash (directly edited the pip-installed file in the dist-packages directory):
argcomplete=$(which register-python-argcomplete{,3})

with

if which register-python-argcomplete >/dev/null 2>&1; then
    argcomplete=$(which register-python-argcomplete)
elif which register-python-argcomplete3 >/dev/null 2>&1; then
    argcomplete=$(which register-python-argcomplete3)
fi
  • Source the modified file: source $(get_ros_command_bash)

With this modification alone, I can use roscd, roslaunch, rosmsg, etc.

Now, it seems that for full zsh support, a few more zsh-compatible scripts to mirror the bash-compatible ones would be needed (e.g., get_current_setup_zsh.py, get_ros_command_zsh.py, etc.)...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions