From 6ad6283895a96b8f8d05eb4174ef8ab3deab2c24 Mon Sep 17 00:00:00 2001 From: dylan araps Date: Fri, 1 Jan 2016 10:41:31 +1100 Subject: [PATCH] Fix linewrap option now working in screen/tmux --- fetch.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fetch.sh b/fetch.sh index cd077f07..910562dc 100755 --- a/fetch.sh +++ b/fetch.sh @@ -535,6 +535,10 @@ clear # Hide the terminal cursor while we print the info tput civis +# Disable line wrap +# Checks to see if we're in a tmux/screen session. +[ $linewrap == "off" ] && printf '\e[?7l' + # Print the title and underline printf "%s\n" "$pad$b$title_color$title$clear" [ $underline == "on" ] && printf "%s\n" "$pad$colon_color$uline$clear" @@ -546,9 +550,6 @@ printinfo () { printf "%s\n" "$info_color$2$clear" } -# Disable line wrap -[ $linewrap == "off" ] && tput rmam - printinfo "$title_os" "$os" printinfo "$title_kernel" "$kernel" printinfo "$title_uptime" "$uptime" @@ -564,7 +565,7 @@ printf "\n" [ $color_blocks == "on" ] && printf "$pad$(printcols)" # Enable line wrap again -[ $linewrap == "off" ] && tput smam +[ $linewrap == "off" ] && printf '\e[?7h' # If w3mimgviewer is found Display the image if type -p /usr/lib/w3m/w3mimgdisplay >/dev/null 2>&1; then