Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: GnuPG 2.1 with Git, problem in zsh, not in ksh



On Oct 28,  8:50pm, Andreas Kusalananda Kähäri wrote:
} Subject: Re: GnuPG 2.1 with Git, problem in zsh, not in ksh
}
} I dunno. I was playing around with qemu the other night, and I typed
} "qemu-system-x86_64" followed by <space> and then <tab> and the shell
} decided to execute the command (possibly in an attempt to figure out
} its usage info somehow) which filled my terminal with all sorts of qemu
} logging crap. Is that a side-effect of using "compinit"?

Yes, that's a side-effect of using "compinit".  The completion function
_qemu invokes "qemu -M \?" to get a list of machines you might want to
run; "logging crap" is probably because the writer of _qemu neglected
to redirect stderr of that command.

diff --git a/Completion/Unix/Command/_qemu b/Completion/Unix/Command/_qemu
index db07eba..3c21c3e 100644
--- a/Completion/Unix/Command/_qemu
+++ b/Completion/Unix/Command/_qemu
@@ -2,7 +2,7 @@
 
 _qemu_log_items () {
   local -a opts hline
-  $service -d \? | while read -A hline; do
+  $service -d \? 2>/dev/null | while read -A hline; do
     [[ $hline[1] = Log ]] && continue
     opts=($opts "${hline[1]}[${hline[2,-1]}]")
   done
@@ -11,7 +11,7 @@ _qemu_log_items () {
 
 local _qemu_machines
 
-_qemu_machines=(${${${(f)"$($service -M \?)"}[2,-1]}%% *})
+_qemu_machines=(${${${(f)"$($service -M \? 2>/dev/null)"}[2,-1]}%% *})
 
 _arguments \
   '-'{fda,fdb,hda,hdb,hdc,hdd,cdrom}':disk image:_files' \



Messages sorted by: Reverse Date, Date, Thread, Author