[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Ctrl-C ignored after pasting a long text in an X terminal emulator



On Fri 03 Feb 2023 at 23:59:38 (+0100), Vincent Lefevre wrote:
> On 2023-01-26 13:09:31 -0500, Greg Wooledge wrote:
> > I don't know a lot about zsh, but I ran it, typed some letters, and
> > pressed Ctrl-U, and they were all erased as expected.
> 
> But the point is multiline, as you did then:
> 
> > One difference that I did notice in zsh is that its handling of Ctrl-U
> > after a bracketed paste is different from bash's.  I used "seq 3 | xclip -i"
> > to load three harmless lines into the paste selection, and then pasted
> > it into zsh, and into bash, and pressed Ctrl-U in each of them.  In the
> > zsh case, only the third line was erased, and the first 2 were still
> > there, and were executed when I pressed Enter.  In bash, all 3 lines
> > were erased, and Enter didn't execute any of them.
> > 
> > Whether that's a bug in zsh, I can't say.
> 
> I would say that's expected and this is actually a bug in bash:
> "kill-whole-line" means to kill the line, not the whole text.

But the whole text /behaves/ as one line containing embedded newlines,
which you will quickly realise if you ever try to edit it before
pressing Enter. If you want to edit something that's apparently
"three lines up", you can't press ↑ to move up three lines:
you have to hold down the ← key and wait until it reaches said
position. And you can add and remove the embedded newlines at will.

When you press Enter, a "transformation" takes place, and the paste
is interpreted in the context in which it finds itself, which can
lead to surprises.

Cheers,
David.

Reply to: