User Tools

Site Tools


eric:computer:bash:shell_scripting:shell.scripting.tput

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
eric:computer:bash:shell_scripting:shell.scripting.tput [2026/10/08 20:34] – created admineric:computer:bash:shell_scripting:shell.scripting.tput [2026/10/08 21:33] (current) – [Bash examples] admin
Line 21: Line 21:
 Sometimes I didn’t find a matching ANSI escape or vice versa - you’ll see a :?: as code then - feel free to mail me or fix it! Sometimes I didn’t find a matching ANSI escape or vice versa - you’ll see a :?: as code then - feel free to mail me or fix it!
  
-The ANSI codes are always intoduced with an ESC character (ASCII 0x1B or octal 033) - this isn’t part of the list, but you should avoid to use the ANSI codes directly - use the tput command!+The ANSI codes are always introduced with an ESC character (ASCII 0x1B or octal 033) - this isn’t part of the list, but you should avoid to use the ANSI codes directly - use the tput command!
  
 All codes that can be used with tput can be found in terminfo(5). (on OpenBSD at least) See OpenBSD’s terminfo(5) under the Capabilities section. The cap-name is the code to use with tput, a description of each code is also provided. General useful ASCII codes All codes that can be used with tput can be found in terminfo(5). (on OpenBSD at least) See OpenBSD’s terminfo(5) under the Capabilities section. The cap-name is the code to use with tput, a description of each code is also provided. General useful ASCII codes
Line 27: Line 27:
 The Ctrl-Key representation is simply associating the non-printable characters from ASCII code 1 with the printable (letter) characters from ASCII code 65 (“A”). ASCII code 1 would be ^A (Ctrl-A), while ASCII code 7 (BEL) would be ^G (Ctrl-G). This is a common representation (and input method) and historically comes from one of the VT series of terminals. The Ctrl-Key representation is simply associating the non-printable characters from ASCII code 1 with the printable (letter) characters from ASCII code 65 (“A”). ASCII code 1 would be ^A (Ctrl-A), while ASCII code 7 (BEL) would be ^G (Ctrl-G). This is a common representation (and input method) and historically comes from one of the VT series of terminals.
  
-^Name^decimal^octal^hex ^C-escape^Ctrl-Key                    ^Description       ^ +^ Name ^ decimal ^ octal ^ hex  ^ C-escape ^ Ctrl-Key                     ^ Description                  ^ 
-|BEL |7      |007  |0x07|        |^G                          |Terminal bell     | +| BEL  | 7       | 007   | 0x07 | \a       | Ctrl-G                       | Terminal bell                | 
-|BS  |8      |010  |0x08|^H      |Backspace                   |                  | +| BS   | 8       | 010   | 0x08 | \b       | Ctrl-H                       | Backspace                    | 
-|HT  |9      |011  |0x09|^I      |Horizontal TAB              |                  | +| HT   | 9       | 011   | 0x09 | \t       | Ctrl-I                       | Horizontal TAB               | 
-|LF  |10     |012  |0x0A|        |^J                          |Linefeed (newline)| +| LF   | 10      | 012   | 0x0A | \n       | Ctrl-J                       | Linefeed (newline)           | 
-|VT  |11     |013  |0x0B|^K      |Vertical TAB                |                  | +| VT   | 11      | 013   | 0x0B | \v       | Ctrl-K                       | Vertical TAB                 | 
-|FF  |12     |014  |0x0C|^L      |Formfeed (also: New page NP)|                  | +| FF   | 12      | 014   | 0x0C | \f       | Ctrl-L                       | Formfeed (also: New page NP) | 
-|CR  |13     |015  |0x0D|^M      |Carriage return             |                  | +| CR   | 13      | 015   | 0x0D | \r       | Ctrl-M                       | Carriage return              | 
-|ESC |27     |033  |0x1B|<none>  |^[                          |Escape character  | +| ESC  | 27      | 033   | 0x1B | <none>   | Ctrl-[                       | Escape character             | 
-|DEL |127    |177  |0x7F|<none>  |<none>                      |Delete character  |+| DEL  | 127     | 177   | 0x7F | <none>   | <none>                       | Delete character             |
  
 ===== Cursor handling ===== ===== Cursor handling =====
Line 249: Line 249:
 ${KSH_VERSION+. doKsh} ${BASH_VERSION+doBash} ${KSH_VERSION+. doKsh} ${BASH_VERSION+doBash}
 </code> </code>
-MORE INFO <html><code></html>tput cols<html></code></html> gives terminal columns <html><code></html>tput lines<html></code></html> gives you number of rows+MORE INFO <code>tput cols</code> gives terminal columns <code>tput lines</code> gives you number of rows
  
-Source: http://wiki.bash-hackers.org/scripting/terminalcodes+Source: http://wiki.bash-hackers.org/scripting/terminalcodes \\ 
 +Original source now offline, try: https://web.archive.org/web/20221019084419/https://wiki.bash-hackers.org/scripting/terminalcodes
  
  
eric/computer/bash/shell_scripting/shell.scripting.tput.1791491661.txt.gz · Last modified: by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki