From 0667b18138e4408c2e7257412201996c6bd8421c Mon Sep 17 00:00:00 2001 From: Dylan Date: Fri, 5 Feb 2016 11:43:19 +1100 Subject: [PATCH] Only trap exit if images are enabled and fix trailing whitespace in getshell --- fetch | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/fetch b/fetch index 056089e3..54620a4e 100755 --- a/fetch +++ b/fetch @@ -639,11 +639,12 @@ getpackages () { getshell () { case "$shell_path" in - "on") shell="$SHELL " ;; - "off") shell="${SHELL##*/} " ;; + "on") shell="$SHELL" ;; + "off") shell="${SHELL##*/}" ;; esac if [ "$shell_version" == "on" ]; then + shell+=" " case "$shell" in *"bash"*) shell+="$(bash --version | head -n 1)" @@ -2163,10 +2164,11 @@ done # Restore cursor and clear screen on ctrl+c trap 'printf "\033[?25h"; clear; exit' 2 -# If the script exits for any reason, unhide the cursor. -trap 'printf "\033[?25h"' EXIT - if [ "$image" != "off" ]; then + # If the script exits for any reason, unhide the cursor. + trap 'printf "\033[?25h"' EXIT + + # Clear the scren clear # Hide the cursor