2016-02-22 19:31:30 -05:00
|
|
|
# tput
|
|
|
|
|
|
|
|
> View and modify terminal settings and capabilities.
|
2021-10-23 23:45:06 +05:00
|
|
|
> More information: <https://manned.org/tput>.
|
2016-02-22 19:31:30 -05:00
|
|
|
|
|
|
|
- Move the cursor to a screen location:
|
|
|
|
|
2022-11-16 17:08:31 +03:00
|
|
|
`tput cup {{row}} {{column}}`
|
2016-02-22 19:31:30 -05:00
|
|
|
|
|
|
|
- Set foreground (af) or background (ab) color:
|
|
|
|
|
|
|
|
`tput {{setaf|setab}} {{ansi_color_code}}`
|
|
|
|
|
2025-02-09 09:20:05 +02:00
|
|
|
- Reverse text and background colors:
|
2016-02-22 19:31:30 -05:00
|
|
|
|
2025-02-09 09:20:05 +02:00
|
|
|
`tput rev`
|
2016-02-22 19:31:30 -05:00
|
|
|
|
2025-02-09 09:20:05 +02:00
|
|
|
- Reset all terminal text attributes:
|
2016-02-22 19:31:30 -05:00
|
|
|
|
2025-02-09 09:20:05 +02:00
|
|
|
`tput sgr0`
|
2016-02-22 19:31:30 -05:00
|
|
|
|
2025-02-09 09:20:05 +02:00
|
|
|
- Show number of columns, lines, or colors:
|
2016-02-22 19:31:30 -05:00
|
|
|
|
2025-02-09 09:20:05 +02:00
|
|
|
`tput {{cols|lines|colors}}`
|
2017-04-15 07:29:28 -04:00
|
|
|
|
2022-12-06 16:48:59 +10:00
|
|
|
- Enable or disable word wrap:
|
2017-04-15 07:29:28 -04:00
|
|
|
|
|
|
|
`tput {{smam|rmam}}`
|
2025-02-09 09:20:05 +02:00
|
|
|
|
|
|
|
- Hide or show the terminal cursor:
|
|
|
|
|
|
|
|
`tput {{civis|cnorm}}`
|
|
|
|
|
|
|
|
- Save or restore terminal text status (smcup also captures scroll wheel events):
|
|
|
|
|
|
|
|
`tput {{smcup|rmcup}}`
|