fix(cli): remove completion markers on system Bash

This commit is contained in:
morluto
2026-10-24 04:33:08 +08:00
parent 7e8c7865d4
commit fd254b5e37
+3 -2
View File
@@ -16,12 +16,13 @@ export const bashCompletionScript = (name: string): string => {
return
fi
local _nospace=false
local _nospace_marker=$'\\001'
local _c
COMPREPLY=()
for _c in "\${_completions[@]}"; do
if [[ "$_c" == *$'\\001' ]]; then
if [[ "$_c" == *"$_nospace_marker" ]]; then
_nospace=true
COMPREPLY+=("\${_c%$'\\001'}")
COMPREPLY+=("\${_c%"$_nospace_marker"}")
else
COMPREPLY+=("$_c")
fi