From f53afe80c9f8c4dd92c253e13e156e5df82bcccf Mon Sep 17 00:00:00 2001 From: Manuele Sarfatti Date: Sun, 11 May 2025 16:11:17 +0200 Subject: [PATCH] Fix cursor potentially disappearing --- src/02.ui/spin.sh | 2 +- src/03.prompt/choose.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/02.ui/spin.sh b/src/02.ui/spin.sh index 27680ec..c320694 100644 --- a/src/02.ui/spin.sh +++ b/src/02.ui/spin.sh @@ -11,7 +11,7 @@ source "$SCRIPT_DIR/../00.utils/movements.sh" source "$SCRIPT_DIR/../01.core/pen.sh" # Make sure the cursor is shown and the spinner stopped if the script exits abnormally -trap spop EXIT INT TERM +trap "spop; show_cursor" EXIT INT TERM # Module state variables _spinner_pid="" diff --git a/src/03.prompt/choose.sh b/src/03.prompt/choose.sh index 9e4e2ad..0a87d45 100644 --- a/src/03.prompt/choose.sh +++ b/src/03.prompt/choose.sh @@ -28,7 +28,7 @@ choose() { # Set prompt with default indicator prompt=$( pen -n blue "${_q:-?} " - pen -n "${2}" + pen -n "${2} " pen gray "[↑↓]" )