Bash completion prints errors from internal commands into the prompt
Author: ricabCreated Sep 25, 2026Updated Sep 25, 2026
LabelsjiraCLIshell completion
Describe the bug Not all internal calls to multipass in bash completion have stderr redirected. When there is an error, it is spliced onto the terminal, at the cursor's position, making everything look garbled. This is more apparent with the new deprecation warnings (on macOS).
In this example, I hit tab right after "up" and the rest of the text appeared:
$ multipass start up*** Warning! The qemu driver is deprecated and will be removed in an upcoming release. ***
We recommend switching to the new hyperv_api driver as soon as possible (multipass set local.driver=hyperv_api). Your instances will not be destroyed but they will be unreachable from the new driver. You can switch back to the old driver for now, but you will need to manually recreate any instances you want to keep in the next release.
*** Warning! The qemu driver is deprecated and will be removed in an upcoming release. ***
We recommend switching to the new hyperv_api driver as soon as possible (multipass set local.driver=hyperv_api). Your instances will not be destroyed but they will be unreachable from the new driver. You can switch back to the old driver for now, but you will need to manually recreate any instances you want to keep in the next release.
lifting-avocet ^CIgnore the hyperv_api text, it would not actually be issued on Linux. I hacked the daemon to cause it to produce it.
To Reproduce
- If using the snap, first source the completion script:
<repo_root>/completions/bash/multipassto use it directly instead of snapd's own completion wrapper (which does throw away stderr). - Make the internal commands fail, e.g. stop the daemon (
snap stop multipassd) - Type
multipass startand press Tab - Observe the error from
multipass listgetting appended to the prompt
Expected behavior Completion silently offers no candidates. Errors should only be shown when the user actually runs a command.
Source: canonical/multipass