summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/completion.bash1
-rw-r--r--shell/completion.zsh1
2 files changed, 2 insertions, 0 deletions
diff --git a/shell/completion.bash b/shell/completion.bash
index 044a35f6..c3121ecc 100644
--- a/shell/completion.bash
+++ b/shell/completion.bash
@@ -499,6 +499,7 @@ if ! declare -F __fzf_list_hosts > /dev/null; then
# 16-year-old mawk unfortunately. We need to use [ \t] instead.
match(tolower($0), /^[ \t]*host(name)?[ \t]*[ \t=]/) {
$0 = substr($0, RLENGTH + 1) # Remove "Host(name)?=?"
+ sub(/#.*/, "")
for (i = 1; i <= NF; i++)
if ($i !~ /[*?%]/)
print $i
diff --git a/shell/completion.zsh b/shell/completion.zsh
index 0f20812a..b9f9baa0 100644
--- a/shell/completion.zsh
+++ b/shell/completion.zsh
@@ -277,6 +277,7 @@ if ! declare -f __fzf_list_hosts > /dev/null; then
# 16-year-old mawk unfortunately. We need to use [ \t] instead.
match(tolower($0), /^[ \t]*host(name)?[ \t]*[ \t=]/) {
$0 = substr($0, RLENGTH + 1) # Remove "Host(name)?=?"
+ sub(/#.*/, "")
for (i = 1; i <= NF; i++)
if ($i !~ /[*?%]/)
print $i