Skip to content

Fix ros2cli + rosidl_cli auto-completion#206

Draft
rhaschke wants to merge 3 commits into
RoboStack:mainfrom
rhaschke:main
Draft

Fix ros2cli + rosidl_cli auto-completion#206
rhaschke wants to merge 3 commits into
RoboStack:mainfrom
rhaschke:main

Conversation

@rhaschke
Copy link
Copy Markdown

@rhaschke rhaschke marked this pull request as draft April 18, 2026 09:02
@rhaschke
Copy link
Copy Markdown
Author

rhaschke commented Apr 18, 2026

The backport from ros-humble doesn't actually work for me 😞. pixi's configured shell-hook is simply wrong:

$ pixi shell-hook -e jazzy
...
source /vol/robostack/.pixi/envs/jazzy/share/bash-completion/completions/*
...

The source command just considers the first file argument. It cannot be used to source multiple files at once!

However, I don't understand, why sourcing $CONDA_PREFIX/setup.sh in /vol/robostack/.pixi/envs/jazzy/etc/conda/activate.d/ros-jazzy-ros-workspace_activate.sh doesn't activate completion in first place. Enabling tracing (export AMENT_TRACE_SETUP_FILES=1) reveals that the corresponding command is correctly created (and evaluated):

# Package: ros2cli
# /vol/robostack/.pixi/envs/jazzy/share/ros2cli/package.dsv
AMENT_CURRENT_PREFIX="/vol/robostack/.pixi/envs/jazzy" _ament_prefix_sh_source_script "/vol/robostack/.pixi/envs/jazzy/share/ros2cli/environment/ros2-argcomplete.bash"

Is it possible that pixi's activation mechanism has changed and executes the activation scripts within a subshell? I'm using pixi 0.67.0.

@Tobias-Fischer
Copy link
Copy Markdown
Contributor

Cc @wolfv @ruben-arts

@rhaschke
Copy link
Copy Markdown
Author

rhaschke commented Apr 18, 2026

Manually sourcing .pixi/envs/jazzy/etc/conda/activate.d/ros-jazzy-ros-workspace_activate.sh enables completion as expected. So, this indeed seems to be a pixi issue.
eval "$(pixi shell-hook -e jazzy)" works as well.

In any case, the following change needs to be applied to that file:

- source $CONDA_PREFIX/setup.sh
+ source $CONDA_PREFIX/setup.bash

@rhaschke
Copy link
Copy Markdown
Author

Is this issue related: prefix-dev/pixi#2330?

@Tobias-Fischer
Copy link
Copy Markdown
Contributor

Hi @wolfv @ruben-arts @baszalmstra - you probably understand this better than me, could you please take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

completion for ros2cli not working

2 participants