[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how does bash recognize when pasted ?
From: |
Chet Ramey |
Subject: |
Re: how does bash recognize when pasted ? |
Date: |
Fri, 8 Nov 2024 09:34:23 -0500 |
User-agent: |
Mozilla Thunderbird |
On 11/7/24 6:38 PM, #!microsuxx wrote:
does it like reads -timeout 0 check for instant input && then stack it up ?
or how
does one paste multiline and then it waits for an additional enter
Pasted text appears on the input stream like any other input. Using
`historical' (non-bracketed) paste, there's nothing to indicate that
text is the product of a paste. When using bracketed paste mode, the
pasted text is delimited by
ESC [ 200 ~ before the text; and
ESC [ 201 ~ after it.
Readline recognizes the bracketed paste indicator and reads input until
it sees the end-of-paste indicator. This allows readline to insert the
text as a unit, suppress interpreting any of the pasted characters as
readline commands, and highlight it.
--
``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/
OpenPGP_signature.asc
Description: OpenPGP digital signature