bug-readline
[Top][All Lists]
Advanced

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

Re: bracketed-paste-mode should default to "off"


From: Chet Ramey
Subject: Re: bracketed-paste-mode should default to "off"
Date: Fri, 25 Feb 2022 11:55:20 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.0

On 2/25/22 2:12 AM, Frederick Eaton wrote:
Dear Karl,

I think a better observation is that
before backeted-paste-mode had been implemented, Chet should have
provided some way to bind a readline key to a shell binding in
~/.inputrc. This is possible in Zsh, and I use it to create bindings
to copy/paste to/from the X clipboard there.

This is application-specific functionality, and bash already provides a way
to bind a readline key sequence to a shell command (bind -x). It's possible
in the same way in zsh, because the zsh line editor is tightly integrated
with the shell.

This doesn't change anything about whether or how bracketed paste mode is
implemented or used. If you have a command that takes text and copies it
to the X clipboard, or returns the text in the X clipboard, you can use it
from a shell function and bind a key sequence to it. You have access to
the current readline line buffer and point, so you can do pretty much
whatever you want.

I suppose what you're looking for is some readline equivalent to bind -x:
run an arbitrary shell command, read the output, and insert it into the
current line. But is that useful to provide within readline when it's so
easy to accomplish in other ways?

If I could paste from the X
clipboard (or some other shared clipboard) within Readline, then I
think I would have no need for bracketed-paste-mode.

I don't see why you think there's a useful distinction here. The purpose of
bracketed-paste mode is to paste from the X (or whatever) clipboard. It's
what you do with the pasted text that differs.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]