aboutsummaryrefslogtreecommitdiff
path: root/internal/wizard.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2020-05-14 12:24:53 +0300
committerromkatv <roman.perepelitsa@gmail.com>2020-05-14 12:24:53 +0300
commitaccbe293cb4de46139985dbb347133a453d6f7e2 (patch)
tree91d4fa9446ae629b5e83f31aaa8c3f4749154e3a /internal/wizard.zsh
parent574754eaf6132467516a0ad85b5142e16890c533 (diff)
wizard: print a message when aborted with ctrl-c
Diffstat (limited to 'internal/wizard.zsh')
-rwxr-xr-xinternal/wizard.zsh11
1 files changed, 10 insertions, 1 deletions
diff --git a/internal/wizard.zsh b/internal/wizard.zsh
index c33f6a11..9be45814 100755
--- a/internal/wizard.zsh
+++ b/internal/wizard.zsh
@@ -23,6 +23,8 @@ else
function restore_screen() {}
fi
+local -i success=0
+
{ # always
local -ri force
@@ -234,7 +236,10 @@ function show_cursor() {
function consume_input() {
local key
- while read -t0 key; do true; done
+ while true; do
+ [[ -t 2 ]]
+ read -t0 -k key || break
+ done 2>/dev/null
}
function quit() {
@@ -271,6 +276,7 @@ function quit() {
print -P " %2Fp10k%f %Bconfigure%b"
print -P ""
fi
+ function quit() {}
exit 1
}
@@ -2051,7 +2057,10 @@ print -rP ""
flowing +c File feature requests and bug reports at "$(href https://github.com/romkatv/powerlevel10k/issues)"
print -rP ""
+success=1
+
} always {
+ (( success )) || quit
consume_input
stty echo 2>/dev/null
show_cursor