From eddb26d490e3e8e2f8024a933445d8369fe8c144 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Thu, 9 Oct 2025 17:14:09 +0200 Subject: [PATCH] completions/ssh: Don't read ":" from historical hosts Fixes #11917 --- share/functions/__ssh_history_completions.fish | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/functions/__ssh_history_completions.fish b/share/functions/__ssh_history_completions.fish index 0b9b5999c..ed9e24360 100644 --- a/share/functions/__ssh_history_completions.fish +++ b/share/functions/__ssh_history_completions.fish @@ -1,4 +1,5 @@ # localization: tier3 function __ssh_history_completions -d "Retrieve `user@host` entries from history" - history --prefix ssh --max=100 | string replace -rf '.* ([A-Za-z0-9._:-]+@[A-Za-z0-9._:-]+).*' '$1' + # Accept the typical hostname/ip chars, but no ":" at the end + history --prefix ssh --max=100 | string replace -rf '.* ([A-Za-z0-9._:-]+@[A-Za-z0-9._:-]*[A-Za-z0-9._-]).*' '$1' end