Bash Prompt HOWTO: $Revision: 0.100 $, $Date: 2009/08/07 02:33:22 $ | ||
---|---|---|
Prev | Chapter 6. Colours and Cursor Movement | Next |
tput can do many things. You have seen it used for colours and moving the cursor. This section includes some of the functions that may be useful in writing prompts. man tput doesn't go into much detail about the available commands, but Emilio Lopes e-mailed me to point out that man terminfo will give you a huge list of capabilities, many of which are device independent, and therefore better than the ANSI escape sequences previously mentioned.
tput Colour Capabilities
Set a background colour using ANSI escape
Set a background colour
Set a foreground colour using ANSI escape
Set a foreground colour
tput Text Mode Capabilities
Set bold mode
turn on half-bright mode
begin underline mode
exit underline mode
Turn on reverse mode
Enter standout mode (bold on rxvt)
Exit standout mode
Turn off all attributes (doesn't work quite as expected)
tput Clear and Insert Capabilities
Erase N characters
clear screen and home cursor
Clear to beginning of line
clear to end of line
clear to end of screen
insert N characters (moves rest of line forward!)
insert N lines
This is by no means a complete list of what terminfo and tput allow, in fact it's only the beginning. man tput and man terminfo if you want to know more.