From fd254b5e37d4f8301441c00a1b39b9e73851d2ee Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Sat, 24 Oct 2026 04:33:08 +0800 Subject: [PATCH] fix(cli): remove completion markers on system Bash --- src/cli/bashCompletionRegistration.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cli/bashCompletionRegistration.ts b/src/cli/bashCompletionRegistration.ts index ef3471479a..4bb8361bdc 100644 --- a/src/cli/bashCompletionRegistration.ts +++ b/src/cli/bashCompletionRegistration.ts @@ -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