From 655fd9d71f22dc3efe4f4fae2da633c93cb67292 Mon Sep 17 00:00:00 2001 From: Douglas Christman Date: Mon, 25 Jan 2016 18:10:31 -0500 Subject: zsh-completion: Escape results for `journalctl --unit` Escape colons and backslashes in unit names. This gives correct completions for units with names like systemd-backlight@backlight:acpi_video0.service and systemd-fsck@dev-disk-by\x2duuid-... --- shell-completion/zsh/_journalctl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'shell-completion/zsh/_journalctl') diff --git a/shell-completion/zsh/_journalctl b/shell-completion/zsh/_journalctl index b50f0cafc9..2bee23b6d3 100644 --- a/shell-completion/zsh/_journalctl +++ b/shell-completion/zsh/_journalctl @@ -34,7 +34,10 @@ _journal_none() { _journal_fields() { local -a _fields cmd cmd=("journalctl" "-F ${@[-1]}" "2>/dev/null" ) - _fields=( ${(f)"$(_call_program fields $cmd[@])"} ) + _fields=$(_call_program fields $cmd[@]) + _fields=${_fields//'\'/'\\'} + _fields=${_fields//':'/'\:'} + _fields=( ${(f)_fields} ) typeset -U _fields _describe 'possible values' _fields } -- cgit v1.2.3-54-g00ecf