bug-bash
[Top][All Lists]
Advanced

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

Re: Subject: Pressing Ctrl-C during any subshell evaluation terminates t


From: Chet Ramey
Subject: Re: Subject: Pressing Ctrl-C during any subshell evaluation terminates the shell
Date: Tue, 13 Oct 2020 11:56:54 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.3.2

On 10/13/20 3:38 AM, felix wrote:
> Issue 627 in direnv's github project show:
> 
> To reproduce this simply:
> 
>     PROMPT_COMMAND="trap -- '' SIGINT; sleep 0.1; trap SIGINT;"
>     read foo
>     ^C           -- will exit current shell --

Thanks, this is easy to work with.

The fix is to note that the shell is to set the default SIGINT handler for
interactive shells when running the second trap command, even though the
shell is not interactive while running PROMPT_COMMAND.

Chet

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