[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Subject: Pressing Ctrl-C during any subshell evaluation terminates t
Re: Subject: Pressing Ctrl-C during any subshell evaluation terminates the shell
Sun, 11 Oct 2020 15:59:27 -0400
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.12.1
On 10/9/20 7:23 PM, Daniel Farina wrote:
> Bash Version: 5.0
> Patch Level: 17
> Release Status: release
> Pressing Ctrl-C during any subshell evaluation terminates the shell. I
> noticed this when using direnv and emacs together: Ctrl-C would not cancel
> a subprocess started by the shell, but would exit the entire shell.
> Relaying this from: https://github.com/direnv/direnv/issues/627
> Per https://github.com/direnv/direnv/issues/627#issuecomment-635611930
> $ cat bash.rc
> eval "$(direnv hook bash)"
What commands does this `direnv' command output?
> $ bash --rcfile bash.rc
> bash$ echo $PROMPT_COMMAND
What does `direnv_hook' do?
> bash$ $(sleep 10) # pressing ^C during those 10 seconds will terminate the
> $ # inner shell terminated
My guess is that it messes with the controlling terminal somehow, causing
the shell to get EOF or -1/EIO when it attempts to read input.
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU email@example.com http://tiswww.cwru.edu/~chet/