completions/ssh: Don't read ":" from historical hosts

Fixes #11917
This commit is contained in:
Fabian Boehm
2025-10-09 17:14:09 +02:00
parent b7fe3190bb
commit eddb26d490

View File

@@ -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