completions/loginctl: accept alphabetic session names

systemd's session_id_valid accepts [a-zA-Z0-9], so allowing only
numbers is wrong.

Fixes #11754

While at it, correct the description; instead of
showing the leader PID, show the seat, which is probably
This commit is contained in:
Johannes Altmanninger
2025-08-26 06:31:27 +02:00
parent 7b8efe3105
commit 4a9fd1bbbb

View File

@@ -29,7 +29,7 @@ complete -c loginctl -f -n "not $seen $commands" -l value -d "When showing prope
complete -c loginctl -f -n "not $seen $commands" -l version -d "Show package version"
function __fish_loginctl_list_sessions
loginctl list-sessions --no-legend --no-pager --output=short | string replace -r '^\s*(\d+)\s+\d+\s+(\S+)\s+(\S+\s+)?(\S+\d+).*' '$1\t$2 at $4'
loginctl list-sessions --no-legend --no-pager --output=short | string replace -r '^\s*(\S+)\s+\d+\s+(\S+)\s+(\S+).*' '$1\t$2 at $3'
end
function __fish_loginctl_list_users