1
0
mirror of https://github.com/Tarrasch/zsh-autoenv.git synced 2024-11-25 16:31:00 +02:00

_autoenv_ask_for_yes: handle/catch Ctrl-C and return

This commit is contained in:
Daniel Hahler 2016-03-06 20:27:15 +01:00
parent 8a80ba7f02
commit f021750e89

View File

@ -210,6 +210,12 @@ _autoenv_deauthorize() {
# This function can be mocked in tests # This function can be mocked in tests
_autoenv_ask_for_yes() { _autoenv_ask_for_yes() {
local answer 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 read answer
if [[ $answer == "yes" ]]; then if [[ $answer == "yes" ]]; then
return 0 return 0