From bbe1d1bcb0f5b639faef8b38e9f5ae81518c7c3a Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 2 Jan 2025 11:50:38 +0900 Subject: [PATCH] bash-completion/journalctl: also escape the current input of user unit Follow-up for cec82cb943d0fd23dd09309be62c6bcde6b47839. --- shell-completion/bash/journalctl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shell-completion/bash/journalctl b/shell-completion/bash/journalctl index e70d7999055..e7b8d57902d 100644 --- a/shell-completion/bash/journalctl +++ b/shell-completion/bash/journalctl @@ -113,6 +113,10 @@ _journalctl() { ;; --user-unit) comps=$(journalctl -F '_SYSTEMD_USER_UNIT' 2>/dev/null) + if ! [[ $cur =~ '\\' ]]; then + cur="$(printf '%q' $cur)" + fi + compopt -o filenames ;; --identifier|-t|--exclude-identifier|-T) comps=$(journalctl -F 'SYSLOG_IDENTIFIER' 2>/dev/null) -- 2.47.3