Fix Tramp container name completion

* lisp/net/tramp-container.el (tramp-container--completion-function):
Use "<>" as separator instead of "\t", which could be modified in
the shell.

Copyright-paperwork-exempt: yes
This commit is contained in:
Samuele FAVAZZA 2026-07-03 13:44:05 +02:00 committed by Michael Albinus
parent e45a83cb70
commit 3b22019ff0

View file

@ -290,14 +290,14 @@ see its function help for a description of the format."
(tramp-skeleton-completion-function method
(when-let* ((raw-list
(shell-command-to-string
(concat program " ps --format '{{.ID}}\t{{.Names}}'")))
(concat program " ps --format '{{.ID}}<>{{.Names}}'")))
(lines (split-string raw-list "\n" 'omit))
(names
(tramp-compat-seq-keep
(lambda (line)
(when (string-match
(rx bol (group (1+ nonl))
"\t" (? (group (1+ nonl))) eol)
"<>" (? (group (1+ nonl))) eol)
line)
(or (match-string 2 line) (match-string 1 line))))
lines)))