zsh-workers
 help / color / mirror / code / Atom feed
From: "Zvi Har'El" <rl@math.technion.ac.il>
To: Zsh hackers list <zsh-workers@sunsite.dk>
Cc: "Nadav Har'El" <nyh@math.technion.ac.il>
Subject: edit-command-line
Date: Tue, 12 Nov 2002 12:39:31 +0200	[thread overview]
Message-ID: <20021112103931.GB16493@fermat.math.technion.ac.il> (raw)

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


                 reply	other threads:[~2002-11-12 10:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021112103931.GB16493@fermat.math.technion.ac.il \
    --to=rl@math.technion.ac.il \
    --cc=nyh@math.technion.ac.il \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).