Created
October 23, 2018 09:22
-
-
Save BuonOmo/9fb91769c6210fc9e4f8b1e5b697f6b4 to your computer and use it in GitHub Desktop.
hide cursor in shell script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
show_cursor() { | |
tput cnorm | |
exit | |
} | |
hide_cursor() { | |
tput civis | |
} | |
trap show_cursor INT TERM | |
hide_cursor | |
echo "some stuff" | |
sleep 10 | |
show_cursor |
Glad it is useful for others :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks!