ANSI/VT100 control sequences:修订间差异
来自 LNN的:not(博客)?
更多操作
以“{{Setlang|en}} https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797 “<code>\e</code>” = C0 control char ESC (U+001B) {|class=wikitable style="float: ...”为内容创建页面 |
无编辑摘要 |
||
| 第32行: | 第32行: | ||
* text styles | * text styles | ||
** clear: <code>\e[m</code> or <code>\e[0m</code> | ** clear: <code>\e[m</code> or <code>\e[0m</code> | ||
** bold: <code>\e[1m</code>, | ** bold: <code>\e[1m</code>, dimmed: <code>\e[2m</code>, disable: <code>\e[22m</code> | ||
** italic: <code>\e[3m</code>, disable: <code>\e[23m</code> | ** italic: <code>\e[3m</code>, disable: <code>\e[23m</code> | ||
** underlined: <code>\e[4m</code>, disable: <code>\e[24m</code> | ** underlined: <code>\e[4m</code>, double: <code>\e[21m</code>, disable: <code>\e[24m</code> | ||
** blinking: <code>\e[5m</code>, disable: <code>\e[25m</code> | ** blinking: <code>\e[5m</code>, disable: <code>\e[25m</code> | ||
** inversed: <code>\e[7m</code>, disable: <code>\e[27m</code> | ** inversed: <code>\e[7m</code>, disable: <code>\e[27m</code> | ||
2021年12月19日 (日) 13:24的版本
https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797
“\e” = C0 control char ESC (U+001B)
| color | code |
|---|---|
| black | 0
|
| red | 1
|
| green | 2
|
| yellow | 3
|
| blue | 4
|
| magenta | 5
|
| cyan | 6
|
| white | 7
|
| custom color | 8;5;<n>m (256-color)8;2;<r>;<g>;<b>m (24-bit RGB)
|
| default color | 9
|
- text styles
- clear:
\e[mor\e[0m - bold:
\e[1m, dimmed:\e[2m, disable:\e[22m - italic:
\e[3m, disable:\e[23m - underlined:
\e[4m, double:\e[21m, disable:\e[24m - blinking:
\e[5m, disable:\e[25m - inversed:
\e[7m, disable:\e[27m - invisible:
\e[8m, disable:\e[28m - text color:
\e[3<color>m - background color:
\e[4<color>m - text color but colors 0 through 7 are brighter:
\e[9<color>m - background color but colors 0 through 7 are brighter:
\e[10<color>m
- clear:
- cursor control
- move up n lines:
\e[<n>A - move down n lines:
\e[<n>B - move right n lines:
\e[<n>C - move left n lines:
\e[<n>D - move to screen upper left corner:
\e[Hor\e[f - move to screen row v:
\e[<v>Hor\e[<v>f - move to screen row v column h:
\e[<v>;<h>Hor\e[<v>;<h>f - reset scrolling region:
\e[r - set scrolling region to rows start through end:
\e[<start>;<end>r - move up:
\eD - move down:
\eM - next line:
\eE - save cursor position:
\e7or\e[s - load saved cursor position:
\e8or\e[u
- move up n lines:
- horizontal tab stops
- add tab at current column:
\eH - remove tab at current column:
\e[gor\e[0g - clear all tabs:
\e[3g
- add tab at current column:
- erase text
- from cursor to line end:
\e[Kor\e[0K - from line start to cursor:
\e[1K - entire line:
\e[2K - from cursor to screen end:
\e[Jor\e[0J - from screen start to cursor:
\e[1J - entire screen:
\e[2J
- from cursor to line end:
- get cursor position:
\e[6n
response (fed into stdin):\e[<v>;<h>R - alternate screen
- open:
\e[?47hor\e[?1049h - close:
\e[?47lor\e[?1049h
- open: