Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save TomZhuPlanetart/c2505daa4e9b60cc78b4c7100385e38a to your computer and use it in GitHub Desktop.
Save TomZhuPlanetart/c2505daa4e9b60cc78b4c7100385e38a to your computer and use it in GitHub Desktop.
Control The Terminal With `tput`
### 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
@TomZhuPlanetart
Copy link
Author

TomZhuPlanetart commented Feb 8, 2024

To get all capabilities.

man terminfo

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