-
Notifications
You must be signed in to change notification settings - Fork 400
Closed
Description
Describe the bug
Since the rewrite of _service() to _comp_complete_service() in 2.12, SysVInit services targets are not being parsed correctly anymore.
This issue only occurs to me now, having upgraded from Devuan Daedalus 5 (deriving from Debian Bookworm 12) to Devuan Excalibur 6 (deriving from Debian Trixie 13).
The bash-completion package is untouched from upstream Debian.
To reproduce
- Grab either:
- a live ISO of Devuan Excalibur 6 from one of the mirrors
- a live ISO of Debian Trixie 13 (for instance the XFCE one)
- Start a shell
- Type
sudo service acpid - Press
- Wrong output:
sudo service acpid start stop restart reload force-reload status start stop

Expected behavior
- Grab either:
- a live ISO of Devuan Excalibur 6 from one of the mirrors
- a live ISO of Debian Trixie 13 (for instance the XFCE one)
- Start a shell
- Type
sudo service acpid - Press
- Targets are being listed

Versions (please complete the following information)
- [*] Operating system name/distribution and version:
- Devuan Excalibur 6
- Debian Trixie 13
- [*] bash version,
echo "$BASH_VERSION":5.2.37(1)-release - [*] bash-completion version,
(IFS=.; echo "${BASH_COMPLETION_VERSINFO[*]}"):2.16.0
Additional context
A patch for the 2.16.0 version would be nice, so it could be suggested as at update at Debian's
Investigation
I was able to produce a basic hack patch, taking the pre-2.12 working part and overwriting the since-2.12 failing one:
--- /usr/share/bash-completion/bash_completion 2025-11-04 20:38:46.147140782 +0100
+++ /usr/share/bash-completion/bash_completion.fixed 2025-11-04 20:38:59.323846976 +0100
@@ -2093,9 +2093,9 @@
else
local sysvdirs
_comp_sysvdirs || return 1
- _comp_compgen_split -l -- "$(command sed -e 'y/|/ /' \
- -ne 's/^.*\(U\|msg_u\)sage.*{\(.*\)}.*$/\2/p' \
- "${sysvdirs[0]}/${prev##*/}" 2>/dev/null) start stop"
+ COMPREPLY=($(compgen -W '`command sed -e "y/|/ /" \
+ -ne "s/^.*\(U\|msg_u\)sage.*{\(.*\)}.*$/\2/p" \
+ ${sysvdirs[0]}/${prev##*/} 2>/dev/null` start stop' -- "$cur"))
fi
} &&
complete -F _comp_complete_service serviceWith this, services targets autocompletion works again, even though it is unsatisfactory to go back to the old behaviour and not use the refactored function.
Metadata
Metadata
Assignees
Labels
No labels