Re: Ctrl-C ignored after pasting a long text in an X terminal emulator
- To: debian-user@lists.debian.org
- Subject: Re: Ctrl-C ignored after pasting a long text in an X terminal emulator
- From: Vincent Lefevre <vincent@vinc17.net>
- Date: Fri, 3 Feb 2023 23:59:38 +0100
- Message-id: <[🔎] 20230203225938.GA3043010@zira.vinc17.org>
- Mail-followup-to: debian-user@lists.debian.org
- In-reply-to: <Y9LB2wKO2JYdswKl@wooledge.org>
- References: <20230122041709.GB143698@zira.vinc17.org> <Y8zD3vELmKbAekA7@axis.corp> <20230123031538.GA244536@zira.vinc17.org> <Y84ar8O0rhTjzVxD@axis.corp> <20230124143449.GA1281444@cventin.lip.ens-lyon.fr> <Y9AI9QWeSxOGEs2O@axis.corp> <20230124172938.GB1313824@cventin.lip.ens-lyon.fr> <Y9GMJ5OsxPvPQuIE@axis.corp> <20230126173424.GA120532@zira.vinc17.org> <Y9LB2wKO2JYdswKl@wooledge.org>
On 2023-01-26 13:09:31 -0500, Greg Wooledge wrote:
> On Thu, Jan 26, 2023 at 06:34:24PM +0100, Vincent Lefevre wrote:
> > About this, Ctrl-U is just a shell feature. Contrary to bash, it is
> > not really usable in zsh to erase long pastes (unless one changes
> > the default bindings). But Ctrl-C is fine in zsh.
>
> Ctrl-U is bound to "kill" at the terminal level (e.g. stty(1)). It's
> more than just a shell feature. You can use it in any setting where
> a terminal is in "canonical mode", e.g. "cat" with no arguments reading
> from a terminal, or a terminal's login prompt.
Shells do not use "canonical mode". In zsh, Ctrl-U is handled by zle,
bash uses readline, AFAIK, so that it depends on the Ctrl-U binding.
See examples in the readline(3readline) man page.
> 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.
--
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Reply to: