From a953445a132e06f3345933163630ee886589e732 Mon Sep 17 00:00:00 2001 From: Ira Abramov Date: Tue, 7 Oct 2025 13:35:38 +0300 Subject: [PATCH 1/2] Fix SSH completion to preserve @ sign in user@host format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SSH completion was removing the @ sign when completing user@host combinations. For example, `ssh root@ser` would complete to `ssh rootserver` instead of `ssh root@server`. **Root Cause:** The @ character was in COMP_WORDBREAKS, causing bash to treat it as a word boundary and remove it during completion. **Solution:** Remove @ from COMP_WORDBREAKS (in addition to : which was already removed). This allows the completion to preserve the full user@host format. **Testing:** - Passes shellcheck with no warnings - Passes shfmt formatting checks - Completion now correctly preserves user@host format Closes #2260 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- completion/available/ssh.completion.bash | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/completion/available/ssh.completion.bash b/completion/available/ssh.completion.bash index 3252267fb0..6ac23706f5 100644 --- a/completion/available/ssh.completion.bash +++ b/completion/available/ssh.completion.bash @@ -1,7 +1,9 @@ # shellcheck shell=bash # Bash completion support for ssh. -export COMP_WORDBREAKS=${COMP_WORDBREAKS/\:/} +# Remove : and @ from COMP_WORDBREAKS to support user@host completion +export COMP_WORDBREAKS=${COMP_WORDBREAKS//:/} +export COMP_WORDBREAKS=${COMP_WORDBREAKS//@/} _sshcomplete() { local line CURRENT_PROMPT="${COMP_WORDS[COMP_CWORD]}" From 6c653cc5142307417e950dd7b5efdb4a9846da3f Mon Sep 17 00:00:00 2001 From: Ira Abramov Date: Tue, 7 Oct 2025 16:04:20 +0300 Subject: [PATCH 2/2] Apply review feedback: combine COMP_WORDBREAKS removals Use character class syntax [:@] to remove both characters in one operation as suggested by @akinomyoga in review. Co-Authored-By: akinomyoga --- completion/available/ssh.completion.bash | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/completion/available/ssh.completion.bash b/completion/available/ssh.completion.bash index 6ac23706f5..dc3ac5b3dd 100644 --- a/completion/available/ssh.completion.bash +++ b/completion/available/ssh.completion.bash @@ -2,8 +2,7 @@ # Bash completion support for ssh. # Remove : and @ from COMP_WORDBREAKS to support user@host completion -export COMP_WORDBREAKS=${COMP_WORDBREAKS//:/} -export COMP_WORDBREAKS=${COMP_WORDBREAKS//@/} +export COMP_WORDBREAKS=${COMP_WORDBREAKS//[:@]/} _sshcomplete() { local line CURRENT_PROMPT="${COMP_WORDS[COMP_CWORD]}"