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

zsh 3.1.9-dev-6: trace output filename problem with patch



When inserting the command to look at the trace output from ^X? in an
editor, zsh forgets to quote the filename.

  zsh% \ls^X?
  Trace output left in /tmp/zsh1708\ls1 (up-history to view)
  ...

  ^P

  emacsclient /tmp/zsh1708\ls1 ;: '\ls'

The problem: the \ in the filename needs to be quoted here but isn't.

The same things happens if there are other characters that require
quoting (such as *) in the first word.  When inserting the editor
command into the history in _complete_debug, can't zsh quote $tmp?
Here is my suggested fix, made from the installed
3.1.9-dev-6/functions directory:

--- _complete_debug.safe	Wed Sep 13 11:05:24 2000
+++ _complete_debug	Thu Sep 14 00:29:57 2000
@@ -18,7 +18,7 @@
 unsetopt xtrace
 
 [[ -t 3 ]] && {
-    print -sR "${VISUAL:-${EDITOR:-${PAGER:-more}}} $tmp ;: $w"
+    print -sR "${VISUAL:-${EDITOR:-${PAGER:-more}}} ${(q)tmp} ;: $w"
     _message -r "Trace output left in $tmp (up-history to view)"
     [[ $compstate[nmatches] -le 1 && $compstate[list] != *force* ]] &&
         compstate[list]='list force messages'



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