On 10/9/20 7:23 PM, Daniel Farina wrote:

> Bash Version: 5.0
> Patch Level: 17
> Release Status: release
> 
> Description:
> 
> 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
> 
> Repeat-By:
> 
> 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
> _direnv_hook

What does `direnv_hook' do?

> bash$ $(sleep 10) # pressing ^C during those 10 seconds will terminate the
> shell
> ^C
> $ # 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.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/

Reply via email to