zsh-workers
 help / color / mirror / code / Atom feed
* bracket-paste-magic adds backslashes inside a quoted string if URL is pasted ("regression" compared to pre-5.1 url-quote-magic)
@ 2016-05-06 20:53 Axel Beckert
  2016-05-08 18:50 ` Bart Schaefer
  0 siblings, 1 reply; 21+ messages in thread
From: Axel Beckert @ 2016-05-06 20:53 UTC (permalink / raw)
  To: zsh-workers

Hi,

I have the following snippet in my .zshrc:

  autoload -U url-quote-magic
  zle -N self-insert url-quote-magic
  autoload -Uz bracketed-paste-magic
  zle -N bracketed-paste bracketed-paste-magic

The latter two lines are only necessary for zsh ≥ 5.1, but don't seem
to do any harm for earlier versions.

Wth this configuration I noticed the following regression which has
probably been added with zsh 5.1: I can't reproduce it with 5.0.7 in
Debian Stable, but can reproduce it with 5.2 in Debian Unstable as
well as with the current git HEAD:

Pasting an URL, e.g.

  https://bugs.debian.org/cgi-bin/pkgreport.cgi?src=zsh

into zsh with url-quote-magic activated resulted in the the following
commandlines with 5.0.7 (pasting starts with the URL, all other
characters were typed):

  % echo https://bugs.debian.org/cgi-bin/pkgreport.cgi\?src\=zsh

  % echo "https://bugs.debian.org/cgi-bin/pkgreport.cgi?src=zsh

  % echo 'https://bugs.debian.org/cgi-bin/pkgreport.cgi?src=zsh

This is exactly what I expect: backslashes for quoting were only added
if no quoting using single or double quotes has been started already.

But with zsh 5.2 (and zsh git HEAD), it looks like this:

  % echo https://bugs.debian.org/cgi-bin/pkgreport.cgi\?src\=zsh

  % echo "https://bugs.debian.org/cgi-bin/pkgreport.cgi\?src\=zsh

  % echo 'https://bugs.debian.org/cgi-bin/pkgreport.cgi\?src\=zsh

While the first example still works as expected, I consider the latter
two examples to be some kind of regression. No backslashes should be
added in these cases.

But it only happens if I paste the full URL. It doesn't happen if I
just type the URL and it doesn't happen if just paste the "?src=zsh".
So I can imagine that this possibly is just a missing feature of
bracketed-paste-magic and not a real regression in url-quote-magic.

		Kind regards, Axel
-- 
/~\  Plain Text Ribbon Campaign                   | Axel Beckert
\ /  Say No to HTML in E-Mail and News            | abe@deuxchevaux.org  (Mail)
 X   See http://www.nonhtmlmail.org/campaign.html | abe@noone.org (Mail+Jabber)
/ \  I love long mails: http://email.is-not-s.ms/ | http://abe.noone.org/ (Web)


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2016-06-10 19:51 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-06 20:53 bracket-paste-magic adds backslashes inside a quoted string if URL is pasted ("regression" compared to pre-5.1 url-quote-magic) Axel Beckert
2016-05-08 18:50 ` Bart Schaefer
2016-05-09 14:13   ` Vincent Lefevre
2016-05-09 15:41     ` Bart Schaefer
2016-05-10  8:58       ` Vincent Lefevre
2016-05-10 19:58         ` Bart Schaefer
2016-05-13  9:23           ` Vincent Lefevre
2016-05-13 11:06             ` Bart Schaefer
2016-05-13 12:19               ` Vincent Lefevre
2016-06-02  7:20                 ` undo problems/crashes (was Re: bracket-paste-magic ...) Bart Schaefer
2016-05-13 22:20               ` bracket-paste-magic adds backslashes inside a quoted string if URL is pasted ("regression" compared to pre-5.1 url-quote-magic) Daniel Shahaf
2016-05-14  1:33                 ` Mikael Magnusson
2016-05-14  3:00                   ` Daniel Shahaf
2016-05-15 11:59                     ` Bart Schaefer
2016-05-19 21:14                       ` Daniel Shahaf
2016-06-02  7:06                         ` zle hook conventions (was Re: bracket-paste-magic ...) Bart Schaefer
2016-06-03 20:40                           ` Daniel Shahaf
2016-06-03 22:51                             ` Bart Schaefer
2016-06-04 16:57                               ` Daniel Shahaf
2016-06-10 17:36                           ` Daniel Shahaf
2016-06-10 19:51                             ` Bart Schaefer

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).