Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
edit-command-line
- X-seq: zsh-workers 17928
- From: "Zvi Har'El" <rl@xxxxxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- Subject: edit-command-line
- Date: Tue, 12 Nov 2002 12:39:31 +0200
- Cc: "Nadav Har'El" <nyh@xxxxxxxxxxxxxxxxxxx>
- Hebrew-date: 7 Kislev 5763
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
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@xxxxxxxxxxxxxxxxxxx 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author