Created
February 8, 2024 01:24
-
-
Save TomZhuPlanetart/c2505daa4e9b60cc78b4c7100385e38a to your computer and use it in GitHub Desktop.
Control The Terminal With `tput`
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
### https://linuxcommand.org/lc3_adv_tput.php | |
# save the content of the screen | |
tput smcup | |
tput cup 0 0 | |
for ((i=0; i<10; i++)); do | |
# set forground color | |
tput setaf $i | |
echo "Hello Worldd" | |
# clear attributes | |
tput sgr0 | |
done | |
sleep 5 | |
# restore content | |
tput rmcup | |
To get all capabilities.
man terminfo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://docs.python.org/3/howto/curses.html
https://www.gnu.org/software/termutils/manual/termutils-2.0/html_chapter/tput_1.html#SEC8