From: Daniel Hahler Date: Sun, 6 Mar 2016 19:27:15 +0000 (+0100) Subject: _autoenv_ask_for_yes: handle/catch Ctrl-C and return X-Git-Url: http://www.git.stargrave.org/?p=zsh-autoenv.git;a=commitdiff_plain;h=f021750e899f483c40691c42cf1f3988fa614f47 _autoenv_ask_for_yes: handle/catch Ctrl-C and return --- diff --git a/autoenv.zsh b/autoenv.zsh index fd73a83..12e058d 100644 --- a/autoenv.zsh +++ b/autoenv.zsh @@ -210,6 +210,12 @@ _autoenv_deauthorize() { # This function can be mocked in tests _autoenv_ask_for_yes() { local answer + + # Handle/catch Ctrl-C and return, instead of letting it potentially abort the + # shell setup process. + setopt localtraps + trap 'return 1' INT + read answer if [[ $answer == "yes" ]]; then return 0