zsh-workers
 help / color / mirror / code / Atom feed
* Regression in bracketed-paste-magic (not in 5.2, but affects 5.3's test releases)
@ 2016-12-07  2:57 Zhiming Wang
  2016-12-07  3:25 ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Zhiming Wang @ 2016-12-07  2:57 UTC (permalink / raw)
  To: zsh-workers

Commit 20948d0 (38579: Functions/Zle/bracketed-paste-magic: simplify saving and
restoring of state) introduced a regression that results in the ZLE buffer
being repeated when pasting under certain conditions. It was introduced after
5.2 and currently affects 5.2-test-1, 5.2-test-2 and master.

Here's a simple reproducer:

1. Set up environment (.zshrc and history) and open a new session with that
   environment:

       cd "$(mktemp -d /tmp/XXXXXXX)"
       cat >.zshrc <<'EOF'
       HISTFILE=$HOME/history
       autoload -Uz bracketed-paste-magic
       zle -N bracketed-paste bracketed-paste-magic
       EOF
       cat >history <<'EOF'
       echo 1
       echo 2
       EOF
       HOME=$PWD zsh

2. Press the following sequence of keys (no space): ^R echo ^R ^E
   (history-incremental-search-backward, "echo",
   history-incremental-search-backward, end-of-line), then paste something,
   say, "zsh".

At this point, we should expect

    echo 1zsh

in the ZLE buffer. Instead, we see

    echo 1zshecho 1

note the buffer prior to pasting being repeated at the end.

Here's a terminal recording that demonstrates the wrong behavior in action:
https://asciinema.org/a/95254.

Best,
Zhiming

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

end of thread, other threads:[~2016-12-24  8:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-07  2:57 Regression in bracketed-paste-magic (not in 5.2, but affects 5.3's test releases) Zhiming Wang
2016-12-07  3:25 ` Bart Schaefer
2016-12-07  4:02   ` Zhiming Wang
2016-12-07 12:39   ` Oliver Kiddle
2016-12-07 18:23     ` Zhiming Wang
2016-12-24  8:28     ` 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).