Skip to content

Instantly share code, notes, and snippets.

@epitron
Created October 13, 2015 22:46
Show Gist options
  • Save epitron/e7674df7e2612c9c8c61 to your computer and use it in GitHub Desktop.
Save epitron/e7674df7e2612c9c8c61 to your computer and use it in GitHub Desktop.
https://code.google.com/p/mintty/wiki/Keycodes
http://rtfm.etla.org/xterm/ctlseq.html
http://man7.org/linux/man-pages/man4/console_codes.4.html
http://www.termsys.demon.co.uk/vtansi.htm
http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
CSI = ESC[
K
Clear line
<n>J
0 = clear to end of screen
1 = clear to beginning of screen
2 = clear entire screen
<n>F
Move up <n>
<n>E
Move down <n>
<n>G
Move to column <n>
<n>L
Insert P s Line(s) (default = 1) (IL).
<n>M
Delete P s Line(s) (default = 1) (DL).
<n>S
SU – Scroll Up by n (default 1)
<n>T
SD – Scroll Down by n (default 1)
<n>;<m>H
<n>;<m>f
HVP – Horizontal and Vertical Position
Moves the cursor to row n, column m. Both default to 1 if omitted.
<top>;<left>;<bottom>;<right>$z
Erase Rectangular Area (DECERA), VT400 and up.
<n>E
CNL – Cursor Next Line
Moves cursor to beginning of the line n
<n>F
CPL – Cursor Previous Line
Moves cursor to beginning of the line n (default 1) lines up.
?25l/?25h
Hide/show cursor
<top>;<bottom>r
Set Scrolling Region [top;bottom] (default = full size of window)
?<n>l
6 = Normal cursor mode
7 = No Wraparound Mode (DECAWM)
9 = Don't send Mouse X & Y on button press.
19 = Limit print to scrolling region (DECPEX).
25 = Hide Cursor (DECTCEM).
?<n>h
7 = Wraparound Mode (DECAWM).
9 = Send mouse x/y on button press
1000 = Send Mouse X & Y on button press and release
<n>n
6 = Report Cursor Position (CPR) [row;column]. Result is CSI<r>;<c>R
ESC 7
Save Cursor (DECSC).
ESC 8
Restore Cursor (DECRC).
J
Erase in Display (ED).
0 = Erase Below (default).
1 = Erase Above.
2 = Erase All.
3 = Erase Saved Lines (xterm).
K
Erase in Line (EL).
0 = Erase to Right (default).
1 = Erase to Left.
2 = Erase All.
M<button><x><y>.
0=MB1 pressed, 1=MB2 pressed, 2=MB3 pressed, 3=release, 64=wheelup, 65=wheeldown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment