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

tests: _autoenv_ask_for_yes: only trap INT with Zsh 5.2+

This commit is contained in:
Daniel Hahler 2017-04-23 23:36:29 +02:00
parent 61faa9431a
commit 650ca1079a

View File

@ -241,7 +241,10 @@ _autoenv_ask_for_yes() {
# Handle/catch Ctrl-C and return, instead of letting it potentially abort the # Handle/catch Ctrl-C and return, instead of letting it potentially abort the
# shell setup process. # shell setup process.
setopt localtraps setopt localtraps
trap 'return 1' INT autoload -Uz is-at-least
if is-at-least 5.2; then
trap 'return 1' INT
fi
read answer read answer
if [[ $answer == "yes" ]]; then if [[ $answer == "yes" ]]; then