bug-bash
[Top][All Lists]
Advanced

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

Re: Cursor jumps to leftmost column on trap ... SIGALRM


From: Chet Ramey
Subject: Re: Cursor jumps to leftmost column on trap ... SIGALRM
Date: Fri, 4 Feb 2022 17:37:06 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.4.1

On 2/4/22 4:11 PM, Markus Schwarzenberg wrote:
On Fri, 4 Feb 2022 13:19:37 -0500
Chet Ramey <chet.ramey@case.edu> wrote:

On 2/4/22 9:54 AM, Markus Schwarzenberg wrote:

Bash Version: 5.1
Patch Level: 8
Release Status: release

Description:
        The position of the cursor changes to the first column when
bash, running inside xterm, receives the signal SIGALRM

Thanks for the report. It's readline and bracketed paste.

Interestingly, I can't reproduce the behavior myself on the
following system (opensuse tumbleweed)

It depends on whether or not bracketed paste is active.


We can force a redisplay in the code that handles the return from the
signal handler. That, however, has its own problems. If the
application's signal handler doesn't do anything, forcing the cursor
to a new line and forcing a redisplay will result in duplicated
lines. (If we don't force a new line, we can potentially overwrite
output from the application's signal handler.)

I'll have to think about it.

I'd be happy with some command forcing redisplay, executed from
within the handler as a workaround.

On a new line? Duplicating what was there before the SIGALRM? I think you'd
be surprised at how many people would disagree with you.


Note: The example given in the bug description is just the simplest way
to reproduce that behavior. Practically I've been using the SIGALRM handler
for really a long period now (ca. 20 years). Usage: It's invoked from
a xterm key binding and finally makes the running bash open a file
guessed from the currently selected ls -l output line (or gcc error line,
etc.). The observed readline behavior is quite new ( < 1 year).
It didn't happen in older versions.

It coincided with the introduction of bracketed-paste, and you probably
noticed it when bracketed-paste became the default.


--
``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]