[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bash spews bracketed-paste escape sequences when handling signal.
From: |
Kaz Kylheku |
Subject: |
Bash spews bracketed-paste escape sequences when handling signal. |
Date: |
Sat, 14 Dec 2024 09:40:33 -0800 |
User-agent: |
Roundcube Webmail/1.4.15 |
Hi!
I first ran into this issue on MacOS using the Homebrew build of Bash 5
(BASH_VERSION "5.2.37(1)-release").
When a trap is installed for a signal, and delivered, Bash sends characters to
the terminal which move the cursor.
Steps to repro:
1. Register the simplest possible trap for the SIGALRM signal:
trap : ALRM
2. In the background, start a loop which delivers the signal to the shell
while sleep 1; do kill -ALRM $$ ; done &
3. Every time the signal is delivered, observe Bash spewing the escape
sequences for disabling and enabling
bracketed paste, with a carriage return in between them that moves the
cursor.
(One way to capture the output is to do the above steps under the "script"
command; then
find the characters in the typescript transcript file.)
If you do not have "trap : ALRM" then this doesn't happen.
The expected behavior is that no output should be produced. Bash should just
handle
the signal and execute the trap without TTY interaction.
See this question on the "Ask Different" Stack Exchange site:
https://apple.stackexchange.com/questions/477385/why-am-i-having-an-issue-with-restoring-cursor-position-when-using-basta-on-maco
Cheers ...
- Bash spews bracketed-paste escape sequences when handling signal.,
Kaz Kylheku <=
- Re: Bash spews bracketed-paste escape sequences when handling signal., Chet Ramey, 2024/12/14
- Re: Bash spews bracketed-paste escape sequences when handling signal., Kaz Kylheku, 2024/12/15
- Re: Bash spews bracketed-paste escape sequences when handling signal., Kaz Kylheku, 2024/12/15
- Re: Bash spews bracketed-paste escape sequences when handling signal., Chet Ramey, 2024/12/18
- Re: Bash spews bracketed-paste escape sequences when handling signal., Kaz Kylheku, 2024/12/18
- Re: Bash spews bracketed-paste escape sequences when handling signal., microsuxxor, 2024/12/18
- Re: Bash spews bracketed-paste escape sequences when handling signal., Kaz Kylheku, 2024/12/18
- Re: Bash spews bracketed-paste escape sequences when handling signal., microsuxxor, 2024/12/18
- Re: Bash spews bracketed-paste escape sequences when handling signal., Chet Ramey, 2024/12/18
- Re: Bash spews bracketed-paste escape sequences when handling signal., Kaz Kylheku, 2024/12/18