zsh-workers
 help / color / mirror / code / Atom feed
* edit-command-line
@ 2002-11-12 10:39 Zvi Har'El
  0 siblings, 0 replies; only message in thread
From: Zvi Har'El @ 2002-11-12 10:39 UTC (permalink / raw)
  To: Zsh hackers list; +Cc: Nadav Har'El

Hi,

The function edit-command-line, which implements the ksh-like editing of the
command line using $EDITOR when v is hit, has a bug, which makes backslashes
escapes evaluated. You can try this by entering the command 

echo 'a\nb'

and hitting escape and v. You enter your $EDITOR, and when you leave it the
command is changed to

echo 'a
b'

which is of course wrong.

The following patch, which adds a -R (raw) option to a print, solves the
problem:

--- /usr/local/share/zsh/4.0.6/functions/edit-command-line.orig
2002-08-14 22:54:06.000000000 +0300
+++ /usr/local/share/zsh/4.0.6/functions/edit-command-line      2002-11-12
12:27:58.000000000 +0200
@@ -11,7 +11,7 @@
 print -R - "$PREBUFFER$BUFFER" >$tmpfile
 exec </dev/tty
 ${VISUAL:-${EDITOR:-vi}} $tmpfile
-print -z - "$(<$tmpfile)" 
+print -Rz - "$(<$tmpfile)" 
 
 command rm -f $tmpfile
 zle send-break         # Force reload from the buffer stack


Best,

Zvi.

-- 
Dr. Zvi Har'El     mailto:rl@math.technion.ac.il     Department of Mathematics
tel:+972-54-227607                   Technion - Israel Institute of Technology
fax:+972-4-8324654 http://www.math.technion.ac.il/~rl/     Haifa 32000, ISRAEL
"If you can't say somethin' nice, don't say nothin' at all." -- Thumper (1942)
                             Tuesday, 7 Kislev 5763, 12 November 2002, 12:32PM


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-11-12 10:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-12 10:39 edit-command-line Zvi Har'El

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).