Skip to content

Instantly share code, notes, and snippets.

@BuonOmo
Created October 23, 2018 09:22
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save BuonOmo/9fb91769c6210fc9e4f8b1e5b697f6b4 to your computer and use it in GitHub Desktop.
Save BuonOmo/9fb91769c6210fc9e4f8b1e5b697f6b4 to your computer and use it in GitHub Desktop.
hide cursor in shell script
show_cursor() {
tput cnorm
exit
}
hide_cursor() {
tput civis
}
trap show_cursor INT TERM
hide_cursor
echo "some stuff"
sleep 10
show_cursor
@Dishendramishra
Copy link

thanks!

@BuonOmo
Copy link
Author

BuonOmo commented Apr 29, 2020

Glad it is useful for others :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment