VT Sequence Reference

A reference of all VT sequences supported by Ghostty.

This page lists many of the VT sequences that Ghostty supports.

This page is a work-in-progress. Ghostty supports many more sequences than are listed here and for the sequences listed here the quality of the linked documentation varies. This is a very contributor friendly area to help improve the documentation!

They are currently grouped by sequence type (control, esc, CSI, etc.) and the listed alphabetically by syntax. In the future, we will introduce better organization and search capabilities.

NameSyntaxDescription
BEL0x07Alert the user (beep)
BS0x08Move cursor backward one position
TAB0x09Move cursor right to the next tab stop
LF0x0AMove cursor down one line, scrolling if necessary
CR0x0DMove cursor to the left margin
DECSCESC 7Save cursor
DECRCESC 8Restore cursor
INDESC DMove cursor down, scrolling if necessary
RIESC MMove cursor up, scrolling if necessary
RISESC cFull reset
DECSCUSRCSI Pn " " qSet cursor style
DECKPAMESC =Set numeric keypad to application mode
DECKPNMESC >Set numeric keypad to numeric mode
DECALNESC # 8Screen alignment test
CUUCSI Pn AMove cursor up
CUDCSI Pn BMove cursor down
CUFCSI Pn CMove cursor right
CUBCSI Pn DMove cursor left
CNLCSI Pn EMove cursor down n lines and to the leftmost column
CPLCSI Pn FMove cursor up n lines and to the leftmost column
CUPCSI Py ; Px HMove cursor to the specified row and column
CHTCSI Pn IMove cursor right n tabs
EDCSI Pn JErase display
ELCSI Pn KErase line
DLCSI Pn MDelete n lines at the cursor
ILCSI Pn LInsert n lines at the cursor
DCHCSI Pn PDelete n characters at the cursor
SUCSI Pn SScroll up n lines
SDCSI Pn TScroll down n lines
ECHCSI Pn XErase n characters at the cursor
CBTCSI Pn ZMove cursor left n tabs
HPRCSI Pn aMove cursor to a column relative to the cursor
REPCSI Pn bRepeat the preceding character n times
VPACSI Py dMove cursor to the specified row
VPRCSI Pn eMove cursor down n rows relative to the cursor
TBCCSI Pn gClear one or all tab stops
DSRCSI Pn nDevice status report
DECSTBMCSI Pt ; Pb rSet top and bottom margins
DECSLRMCSI Pl ; Pr sSet left and right margins
ICHCSI Pn @Insert n characters at the cursor
HPACSI Px `Move cursor to the specified column
XTSHIFTESCAPECSI > Pn sConfigure shift modifier behavior with mouse reports
OSC 0OSC 0 ; Pt STChange window icon and window title
OSC 1OSC 1 ; Pt STChange window icon
OSC 2OSC 2 ; Pt STChange window title
OSC 4OSC 4 ; Pn ; Pc STQuery or change palette colors
OSC 5OSC 5 ; Pn ; Pc STQuery or change special colors
OSC 7OSC 7 ; Pu ; STChange the working directory
OSC 8OSC 8 ; Pp ; Pu ; STBegin or end a hyperlink
OSC 9OSC 9 ; Pt ; STShow a desktop notification
OSC 9;4OSC 9 ; 4 ; Ps ; Pn ; STReport progress state
OSC 10OSC 10 ; Pc STQuery or change the foreground color
OSC 11OSC 11 ; Pc STQuery or change the background color
OSC 12OSC 12 ; Pc STQuery or change the cursor color
OSC 13OSC 13 ; Pc STQuery or change the pointer foreground color
OSC 14OSC 14 ; Pc STQuery or change the pointer background color
OSC 15OSC 15 ; Pc STQuery or change the Tektronix foreground color
OSC 16OSC 16 ; Pc STQuery or change the Tektronix background color
OSC 17OSC 17 ; Pc STQuery or change the highlight background color
OSC 18OSC 18 ; Pc STQuery or change the Tektronix cursor color
OSC 19OSC 19 ; Pc STQuery or change the highlight foreground color
OSC 21OSC 21 ; Pk = Pv ; ... ST Query or change any color using the Kitty Color Protocol
OSC 22OSC 22 ; Pt ST Change the pointer shape
OSC 52OSC 52 ; Pc ; Pd ST Query or change clipboard data
OSC 104OSC 104 ; Pn STReset palette colors
OSC 105OSC 105 ; Pn STReset special colors
OSC 110OSC 110 STReset the foreground color
OSC 111OSC 111 STReset the background color
OSC 112OSC 112 STReset the cursor color
OSC 113OSC 113 STReset the pointer foreground color
OSC 114OSC 114 STReset the pointer background color
OSC 115OSC 115 STReset the Tektronix foreground color
OSC 116OSC 116 STReset the Tektronix background color
OSC 117OSC 117 STReset the highlight background color
OSC 118OSC 118 STReset the Tektronix cursor color
OSC 119OSC 119 STReset the highlight foreground color