From 650ca1079a1aae73654348d67a65c8829945edc3 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 23 Apr 2017 23:36:29 +0200 Subject: [PATCH] tests: _autoenv_ask_for_yes: only trap INT with Zsh 5.2+ --- autoenv.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autoenv.zsh b/autoenv.zsh index 2164bd3..e27ef75 100644 --- a/autoenv.zsh +++ b/autoenv.zsh @@ -241,7 +241,10 @@ _autoenv_ask_for_yes() { # Handle/catch Ctrl-C and return, instead of letting it potentially abort the # shell setup process. 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 if [[ $answer == "yes" ]]; then