<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>docs/escape-sequences.md - fork/wezterm @ termiz-0.23.3</title>
<meta name="description" content="docs/escape-sequences.md in fork/wezterm at termiz-0.23.3.">
<meta property="og:title" content="docs/escape-sequences.md - fork/wezterm @ termiz-0.23.3">
<meta property="og:description" content="docs/escape-sequences.md in fork/wezterm at termiz-0.23.3.">
<meta property="og:type" content="website">
<meta property="og:site_name" content="git.julia.blue">
<link rel="stylesheet" href="/css/style.css?v=62">
<script type="module" src="/js/main.js?v=62"></script>
</head>
<body>
<main data-ref="termiz-0.23.3" data-tip="4bf28e253c0167102f07bfc7e7199c13eed98012">
<noscript>
  <div class="callout">
    <p>
      hey! this is a static git repo viewer. commit diffs, file history,
      older commits and other revisions won't load without javascript.
    </p>
    <p>
      you are still able to view source files on branch/tag tips,
      but the experience is degraded.
    </p>
  </div>
</noscript>
<header class="repo"><div>
<h1>fork/wezterm</h1>
</div>
<pre class="clone">git clone https://git.julia.blue/fork/wezterm</pre>
</header>
<p class="snapshot-commit"><span class="commit-author">Wez Furlong</span><span class="commit-message" data-commit="11c4b11669d9ce23d51afaf286b5383fbdc9794f">s,wez/wezterm,wezterm/wezterm,</span><span class="snapshot-sha sha" data-commit="11c4b11669d9ce23d51afaf286b5383fbdc9794f">11c4b1166</span><time datetime="2025-02-07T13:08:01-07:00" title="2025-02-07 13:08:01 -0700">2025-02-07</time></p>
<header class="topbar"><details class="switcher"><summary>termiz-0.23.3</summary><div class="menu"><strong>branches</strong><a href="/fork/wezterm/ref/main/">main</a><strong>tags</strong><a href="/fork/wezterm/ref/termiz-0.23.1/">termiz-0.23.1</a><a href="/fork/wezterm/ref/termiz-0.23.2/">termiz-0.23.2</a><a class="current" href="/fork/wezterm/ref/termiz-0.23.3/">termiz-0.23.3</a><a href="/fork/wezterm/ref/termwiz-0.23.0/">termwiz-0.23.0</a><a href="/fork/wezterm/ref/termwiz-0.23.1/">termwiz-0.23.1</a><a href="/fork/wezterm/ref/termwiz-0.23.2/">termwiz-0.23.2</a><a href="/fork/wezterm/ref/termwiz-0.23.3/">termwiz-0.23.3</a><a href="/fork/wezterm/ref/vtparse-0.7.0/">vtparse-0.7.0</a><a class="all" href="/fork/wezterm/refs">all refs →</a></div></details><nav class="crumbs"><a href="/fork/wezterm/">wezterm</a> / <a href="/fork/wezterm/ref/termiz-0.23.3/tree/docs/">docs</a> / <span class="cur">escape-sequences.md</span></nav>
<span class="view-stats"><span>22.7 KiB</span><span>415 lines</span></span><span class="actions"><a class="raw" href="/fork/wezterm/raw/ea1715b3c43f4db0c850839eec820b8084f301a7/docs/escape-sequences.md">raw</a></span></header>
<div class="markdown-view"><input type="radio" name="markdown-view" id="markdown-rendered" checked><label for="markdown-rendered">rendered</label><input type="radio" name="markdown-view" id="markdown-code"><label for="markdown-code">code</label><section class="readme rendered"><blockquote>
<p>Please note that this is a "living document" and may lag or lead the state
of the current stable release in a number of areas--as you might imagine,
precisely documenting escape codes and their behaviors and cross-checking
with the various technical documents is laborious and tedious and I only
have so much spare time!</p>
<p>If you notice that something is inaccurate or missing, please do <a href="https://github.com/wezterm/wezterm/issues/new/choose">file an issue</a>
so that it can be resolved!</p>
</blockquote>
<h2>Output/Escape Sequences</h2>
<p>WezTerm considers the output from the terminal to be a UTF-8 encoded stream of
codepoints.  No other encoding is supported.  As described below, some C1
control codes have both 7-bit ASCII compatible as well as 8-bit
representations.  As ASCII is a compatible subset of UTF-8, the 7-bit
representations are preferred and processed without any special consideration.</p>
<p>The 8-bit values <em>are</em> recognized, but only if the 8-bit value is treated as a
unicode code point and encoded via a UTF-8 multi-byte sequence.</p>
<h3>Printable Codepoints</h3>
<p>Codepoints with value 0x20 and higher are considered to be printable and are
applied to the terminal display using the following rules:</p>
<ul>
<li>Codepoints are buffered until a C0, C1 or other escape/control sequence is encountered,
which triggers a flush and processing continues with the next step.</li>
<li>The buffered codepoint sequence is split into unicode graphemes, which means that
combining sequences and emoji are decoded.  Processing continues for below for
each individually recognized grapheme.</li>
<li>If DEC line drawing mode is active, graphemes <code>j-n</code>, <code>q</code>, <code>t-x</code> are translated
to equivalent line drawing graphemes and processing continues.</li>
<li>If prior output/actions require it, the cursor position may be moved to a new line
and the terminal display may be scrolled to make accommodate it.</li>
<li>An appropriate number of cells, starting at the current cursor position,
are allocated based on the column width of the current grapheme and are assigned
to the grapheme.  The current current graphics rendition state (such as colors
and other presentation attributes) is also applied to those cells.
If insert mode is active, those cells will be inserted at the current cursor
position, otherwise they will overwrite cells at the current cursor position.</li>
<li>The cursor position will be updated based on the column width of the grapheme.</li>
</ul>
<p>After the graphemes are applied to the terminal display, the rendering portion of
WezTerm will attempt to apply your <a href="/fork/wezterm/ref/termiz-0.23.3/blob/docs/config/font-shaping.md">font shaping</a> configuration
based on runs of graphemes with matching graphic attributes to determine which glyphs
should be rendered from your fonts; it is at this stage that emoji and ligatures are
resolved.</p>
<h3>C0 Control Codes</h3>
<p>Codepoints in the range <code>0x00-0x1F</code> are considered to be <code>C0</code> control codes.
<code>C0</code> controls will flush any buffered printable codepoints before triggering
the action described below.</p>
<table><thead><tr><th>Seq</th><th>Hex</th><th>Name</th><th>Description</th><th>Action</th></tr></thead><tbody>
<tr><td>^@</td><td>0x00</td><td>NUL</td><td>Null</td><td>Ignored</td></tr>
<tr><td>^A</td><td>0x01</td><td>SOH</td><td>Start of Heading</td><td>Ignored</td></tr>
<tr><td>^B</td><td>0x02</td><td>STX</td><td>Start of Text</td><td>Ignored</td></tr>
<tr><td>^C</td><td>0x03</td><td>ETX</td><td>End of Text</td><td>Ignored</td></tr>
<tr><td>^D</td><td>0x04</td><td>EOT</td><td>End of Transmission</td><td>Ignored</td></tr>
<tr><td>^E</td><td>0x05</td><td>ENQ</td><td>Enquiry</td><td>Ignored</td></tr>
<tr><td>^F</td><td>0x06</td><td>ACK</td><td>Acknowledge</td><td>Ignored</td></tr>
<tr><td>^G</td><td>0x07</td><td>BEL</td><td>Bell</td><td>Logs <code>Ding! (this is the bell)</code> to stderr of the WezTerm process. See <a href="https://github.com/wezterm/wezterm/issues/3">#3</a></td></tr>
<tr><td>^H</td><td>0x08</td><td>BS</td><td>Backspace</td><td>Move cursor left by 1, constrained by the left margin. If Reverse Wraparound and dec auto wrap modes are enabled, moving left of the left margin will jump the cursor to the right margin, jumping to bottom right margin if it was at the top left.</td></tr>
<tr><td>^I</td><td>0x09</td><td>HT</td><td>Horizontal Tab</td><td>Move cursor right to the next tab stop</td></tr>
<tr><td>^J</td><td>0x0A</td><td>LF</td><td>Line Feed</td><td>If cursor is at the bottom margin, scroll the region up, otherwise move cursor down 1 row</td></tr>
<tr><td>^K</td><td>0x0B</td><td>VT</td><td>Vertical Tab</td><td>Treated as Line Feed</td></tr>
<tr><td>^L</td><td>0x0C</td><td>FF</td><td>Form Feed</td><td>Treated as Line Feed</td></tr>
<tr><td>^M</td><td>0x0D</td><td>CR</td><td>Carriage Return</td><td>If cursor is left of leftmost margin, move to column 0. Otherwise move to left margin</td></tr>
<tr><td>^N</td><td>0x0E</td><td>SO</td><td>Shift Out</td><td>Ignored</td></tr>
<tr><td>^O</td><td>0x0F</td><td>SI</td><td>Shift In</td><td>Ignored</td></tr>
<tr><td>^P</td><td>0x10</td><td>DLE</td><td>Data Link Escape</td><td>Ignored</td></tr>
<tr><td>^Q</td><td>0x11</td><td>DC1</td><td>Device Control One</td><td>Ignored</td></tr>
<tr><td>^R</td><td>0x12</td><td>DC2</td><td>Device Control Two</td><td>Ignored</td></tr>
<tr><td>^S</td><td>0x13</td><td>DC3</td><td>Device Control Three</td><td>Ignored</td></tr>
<tr><td>^T</td><td>0x14</td><td>DC4</td><td>Device Control Four</td><td>Ignored</td></tr>
<tr><td>^U</td><td>0x15</td><td>NAK</td><td>Negative Acknowledge</td><td>Ignored</td></tr>
<tr><td>^V</td><td>0x16</td><td>SYN</td><td>Synchronous Idle</td><td>Ignored</td></tr>
<tr><td>^W</td><td>0x17</td><td>ETB</td><td>End Transmission Block</td><td>Ignored</td></tr>
<tr><td>^X</td><td>0x18</td><td>CAN</td><td>Cancel</td><td>Ignored</td></tr>
<tr><td>^Y</td><td>0x19</td><td>EM</td><td>End of Medium</td><td>Ignored</td></tr>
<tr><td>^Z</td><td>0x1A</td><td>SUB</td><td>Substitute</td><td>Ignored</td></tr>
<tr><td>^[</td><td>0x1B</td><td>ESC</td><td>Escape</td><td>Introduces various escape sequences described below</td></tr>
<tr><td>^|0x1C</td><td>FS</td><td>File Separator</td><td>Ignored</td><td></td></tr>
<tr><td>^]</td><td>0x1D</td><td>GS</td><td>Group Separator</td><td>Ignored</td></tr>
<tr><td>^^</td><td>0x1E</td><td>RS</td><td>Record Separator</td><td>Ignored</td></tr>
<tr><td>^_</td><td>0x1F</td><td>US</td><td>Unit Separator</td><td>Ignored</td></tr>
</tbody></table>
<h3>C1 Control Codes</h3>
<p>As mentioned above, WezTerm only supports UTF-8 encoding.  C1 control codes
have an 8-bit representation as well as a multi-codepoint 7-bit escape sequence.</p>
<p>The 8-bit representation is recognized if the 8-bit value is treated as a
unicode code point and encoded as a multi-byte UTF-8 sequence.  Sending the
8-bit binary value will not be recognized as intended, as those bitsequences
are passing through a UTF-8 decoder.</p>
<p>The table below lists the 7-bit <code>C1</code> sequence (which is preferred) as well as the
codepoint value, along with the corresponding meaning.</p>
<p>As with <code>C0</code> control codes, <code>C1</code> controls will flush any buffered printable
codepoints before triggering the action described below.</p>
<table><thead><tr><th>Seq</th><th>Codepoint</th><th>Name</th><th>Description</th><th>Action</th></tr></thead><tbody>
<tr><td>ESC D</td><td>0x84</td><td>IND</td><td>Index</td><td>Moves the cursor down one line in the same column. If the cursor is at the bottom margin, the page scrolls up</td></tr>
<tr><td>ESC E</td><td>0x85</td><td>NEL</td><td>Next Line</td><td>Moves the cursor to the left margin on the next line. If the cursor is at the bottom margin, scroll the page up</td></tr>
<tr><td>ESC H</td><td>0x88</td><td>HTS</td><td>Horizontal Tab Set</td><td>Sets a horizontal tab stop at the column where the cursor is</td></tr>
<tr><td>ESC M</td><td>0x8D</td><td>RI</td><td>Reverse Index</td><td>Move the cursor up one line. If the cursor is at the top margin, scroll the region down</td></tr>
<tr><td>ESC P</td><td>0x90</td><td>DCS</td><td>Device Control String</td><td>Discussed below</td></tr>
<tr><td>ESC [</td><td>0x9B</td><td>CSI</td><td>Control Sequence Introducer</td><td>Discussed below</td></tr>
<tr><td>ESC |0x9C</td><td>ST</td><td>String Terminator</td><td>No direct effect; ST is used to delimit the end of OSC style escape sequences</td><td></td></tr>
</tbody></table>
<h3>Other Escape Sequences</h3>
<p>As these sequences start with an <code>ESC</code>, which is a <code>C0</code> control, these will
flush any buffered printable codepoints before triggering the associated
action.</p>
<table><thead><tr><th>Seq</th><th>Name</th><th>Description</th><th>Action</th></tr></thead><tbody>
<tr><td>ESC c</td><td><a href="https://vt100.net/docs/vt510-rm/RIS.html">RIS</a></td><td>Reset to Initial State</td><td>Resets tab stops, margins, modes, graphic rendition, palette, activates primary screen, erases the display and moves cursor to home position</td></tr>
<tr><td>ESC 7</td><td><a href="https://vt100.net/docs/vt510-rm/DECSC.html">DECSC</a></td><td>Save Cursor Position</td><td>Records cursor position</td></tr>
<tr><td>ESC 8</td><td><a href="https://vt100.net/docs/vt510-rm/DECRC.html">DECRC</a></td><td>Restored Saved Cursor Position</td><td>Moves cursor to location it had when DECSC was used</td></tr>
<tr><td>ESC =</td><td><a href="https://vt100.net/docs/vt510-rm/DECPAM.html">DECPAM</a></td><td>Application Keypad</td><td>Enable Application Keypad Mode</td></tr>
<tr><td>ESC &gt;</td><td><a href="https://vt100.net/docs/vt510-rm/DECPNM.html">DECPNM</a></td><td>Normal Keypad</td><td>Set Normal Keypad Mode</td></tr>
<tr><td>ESC (0</td><td></td><td>DEC Line Drawing character set</td><td>Translate characters <code>j-x</code> to line drawing glyphs</td></tr>
<tr><td>ESC (B</td><td></td><td>US ASCII character set</td><td>Disables DEC Line Drawing character translation</td></tr>
<tr><td>ESC #8</td><td><a href="https://vt100.net/docs/vt510-rm/DECALN.html">DECALN</a></td><td>Screen Alignment Display</td><td>Fills the display with <code>E</code> characters for diagnostic/test purposes (for vttest)</td></tr>
</tbody></table>
<h3>CSI - Control Sequence Introducer Sequences</h3>
<p>CSI sequences begin with the <code>C1</code> <code>CSI</code> sequence, which is either the 7-bit
<code>ESC [</code> sequence or the codepoint <code>0x9B</code>.</p>
<p>WezTerm classifies these sequences into a number of functional families which
are broken out below.</p>
<h4>Graphic Rendition (SGR)</h4>
<p>SGR sequences are of the form <code>CSI DIGITS [; DIGITS ]+ m</code>.  That is, any number
of semicolon separated numbers, terminated by the <code>m</code> codepoint.  There are a handful
of slightly more modern sequences that use colon <code>:</code> codepoints to encode additional
context.</p>
<p>The digits map to one of the codes in the table below, which manipulate the
presentation attributes of subsequently printed characters.</p>
<p>It is valid to omit the code number; for example <code>CSI m</code> is equivalent to <code>CSI 0 m</code> which resets the presentation attributes.</p>
<table><thead><tr><th>Code</th><th>Description</th><th>Action</th></tr></thead><tbody>
<tr><td>0</td><td>Reset</td><td>Reset to default foreground/background colors, reset all presentation attributes, clear any explicit hyperlinks</td></tr>
<tr><td>1</td><td>IntensityBold</td><td>Set the intensity level to Bold.  This causes subsequent text to be rendered in a bold font variant and, if the foreground color is set to a palette index in the 0-7 range, effectively shifts it to the brighter value in the 8-15 range</td></tr>
<tr><td>2</td><td>IntensityDim</td><td>Set the intensity level to Dim or Half-Bright.  This causes text to be rendered in a lighter weight font variant</td></tr>
<tr><td>3</td><td>ItalicOn</td><td>Sets the italic attribute on the text, causing an italic font variant to be selected</td></tr>
<tr><td>4</td><td>UnderlineOn</td><td>Text will have a single underline</td></tr>
<tr><td>4:0</td><td>UnderlineOff</td><td>Text will have no underline</td></tr>
<tr><td>4:1</td><td>UnderlineOn</td><td>Text will have a single underline</td></tr>
<tr><td>4:2</td><td>UnderlineDouble</td><td>Text will be rendered with double underline</td></tr>
<tr><td>4:3</td><td>UnderlineCurly</td><td>Text will be rendered with a curly underline</td></tr>
<tr><td>4:4</td><td>UnderlineDotted</td><td>Text will be rendered with a dotted underline</td></tr>
<tr><td>4:5</td><td>UnderlineDashed</td><td>Text will be rendered with a dashed underline</td></tr>
<tr><td>5</td><td>BlinkOn</td><td>Indicates that the text should blink &lt;150 times per minute</td></tr>
<tr><td>6</td><td>RapidBlinkOn</td><td>Indicates that the text should blink &gt;150 times per minute</td></tr>
<tr><td>7</td><td>InverseOn</td><td>Causes the foreground and background colors to be swapped</td></tr>
<tr><td>8</td><td>InvisibleOn</td><td>Marks text as invisible.</td></tr>
<tr><td>9</td><td>StrikeThroughOn</td><td>Text will be rendered with a single line struck through the middle</td></tr>
<tr><td>21</td><td>UnderlineDouble</td><td>Text will be rendered with double underline</td></tr>
<tr><td>22</td><td>NormalIntensity</td><td>Cancels the effect of IntensityBold and IntensityDim, returning the text to normal intensity</td></tr>
<tr><td>23</td><td>ItalicOff</td><td>Cancels the effect of ItalicOn</td></tr>
<tr><td>24</td><td>UnderlineOff</td><td>Text will have no underline</td></tr>
<tr><td>25</td><td>BlinkOff</td><td>Cancels the effect of BlinkOn and RapidBlinkOn</td></tr>
<tr><td>27</td><td>InverseOff</td><td>Cancels the effect of InverseOn</td></tr>
<tr><td>28</td><td>InvisibleOff</td><td>cancels the effect of InvisibleOn</td></tr>
<tr><td>29</td><td>StrikeThroughOff</td><td>Cancels the effect of StrikeThroughOn</td></tr>
<tr><td>30</td><td>ForegroundBlack</td><td>Sets the foreground color to ANSI Black, which is palette index 0</td></tr>
<tr><td>31</td><td>ForegroundRed</td><td>Sets the foreground color to ANSI Red, which is palette index 1</td></tr>
<tr><td>32</td><td>ForegroundGreen</td><td>Sets the foreground color to ANSI Green, which is palette index 2</td></tr>
<tr><td>33</td><td>ForegroundYellow</td><td>Sets the foreground color to ANSI Yellow, which is palette index 3</td></tr>
<tr><td>34</td><td>ForegroundBlue</td><td>Sets the foreground color to ANSI Blue, which is palette index 4</td></tr>
<tr><td>35</td><td>ForegroundMagenta</td><td>Sets the foreground color to ANSI Magenta, which is palette index 5</td></tr>
<tr><td>36</td><td>ForegroundCyan</td><td>Sets the foreground color to ANSI Cyan, which is palette index 6</td></tr>
<tr><td>37</td><td>ForegroundWhite</td><td>Sets the foreground color to ANSI White, which is palette index 7</td></tr>
<tr><td>39</td><td>ForegroundDefault</td><td>Sets the foreground color to the user's configured default text color</td></tr>
<tr><td>40</td><td>BackgroundBlack</td><td>Sets the background color to ANSI Black, which is palette index 0</td></tr>
<tr><td>41</td><td>BackgroundRed</td><td>Sets the background color to ANSI Red, which is palette index 1</td></tr>
<tr><td>42</td><td>BackgroundGreen</td><td>Sets the background color to ANSI Green, which is palette index 2</td></tr>
<tr><td>43</td><td>BackgroundYellow</td><td>Sets the background color to ANSI Yellow, which is palette index 3</td></tr>
<tr><td>44</td><td>BackgroundBlue</td><td>Sets the background color to ANSI Blue, which is palette index 4</td></tr>
<tr><td>45</td><td>BackgroundMagenta</td><td>Sets the background color to ANSI Magenta, which is palette index 5</td></tr>
<tr><td>46</td><td>BackgroundCyan</td><td>Sets the background color to ANSI Cyan, which is palette index 6</td></tr>
<tr><td>47</td><td>BackgroundWhite</td><td>Sets the background color to ANSI White, which is palette index 7</td></tr>
<tr><td>49</td><td>BackgroundDefault</td><td>Sets the background color to the user's configured default background color</td></tr>
<tr><td>53</td><td>OverlineOn</td><td>Renders text with a single overline/overbar</td></tr>
<tr><td>55</td><td>OverlineOff</td><td>Cancels OverlineOn</td></tr>
<tr><td>59</td><td>UnderlineColorDefault</td><td>Resets the underline color to default, which is to match the foreground color</td></tr>
<tr><td>73</td><td>VerticalAlignSuperScript</td><td>Adjusts the baseline of the text so that it renders as superscript {{since('20221119-145034-49b9839f', inline=True)}}</td></tr>
<tr><td>74</td><td>VerticalAlignSubScript</td><td>Adjusts the baseline of the text so that it renders as subscript {{since('20221119-145034-49b9839f', inline=True)}}</td></tr>
<tr><td>75</td><td>VerticalAlignBaseLine</td><td>Reset the baseline of the text to normal {{since('20221119-145034-49b9839f', inline=True)}}</td></tr>
<tr><td>90</td><td>ForegroundBrightBlack</td><td>Sets the foreground color to Bright Black, which is palette index 8</td></tr>
<tr><td>91</td><td>ForegroundBrightRed</td><td>Sets the foreground color to Bright Red, which is palette index 9</td></tr>
<tr><td>92</td><td>ForegroundBrightGreen</td><td>Sets the foreground color to Bright Green, which is palette index 10</td></tr>
<tr><td>93</td><td>ForegroundBrightYellow</td><td>Sets the foreground color to Bright Yellow, which is palette index 11</td></tr>
<tr><td>94</td><td>ForegroundBrightBlue</td><td>Sets the foreground color to Bright Blue, which is palette index 12</td></tr>
<tr><td>95</td><td>ForegroundBrightMagenta</td><td>Sets the foreground color to Bright Magenta, which is palette index 13</td></tr>
<tr><td>96</td><td>ForegroundBrightCyan</td><td>Sets the foreground color to Bright Cyan, which is palette index 14</td></tr>
<tr><td>97</td><td>ForegroundBrightWhite</td><td>Sets the foreground color to Bright White, which is palette index 15</td></tr>
<tr><td>100</td><td>BackgroundBrightBlack</td><td>Sets the background color to Bright Black, which is palette index 8</td></tr>
<tr><td>101</td><td>BackgroundBrightRed</td><td>Sets the background color to Bright Red, which is palette index 9</td></tr>
<tr><td>102</td><td>BackgroundBrightGreen</td><td>Sets the background color to Bright Green, which is palette index 10</td></tr>
<tr><td>103</td><td>BackgroundBrightYellow</td><td>Sets the background color to Bright Yellow, which is palette index 11</td></tr>
<tr><td>104</td><td>BackgroundBrightBlue</td><td>Sets the background color to Bright Blue, which is palette index 12</td></tr>
<tr><td>105</td><td>BackgroundBrightMagenta</td><td>Sets the background color to Bright Magenta, which is palette index 13</td></tr>
<tr><td>106</td><td>BackgroundBrightCyan</td><td>Sets the background color to Bright Cyan, which is palette index 14</td></tr>
<tr><td>107</td><td>BackgroundBrightWhite</td><td>Sets the background color to Bright White, which is palette index 15</td></tr>
</tbody></table>
<p>There are a handful of additional SGR codes that allow setting extended colors;
unlike the codes above, which are activated by a single numeric parameter out
of SGR sequence, these the extended color codes require multiple parameters.
The canonical representation of these sequences is to have the multiple
parameters be separated by colons (<code>:</code>), but for compatibility reasons WezTerm
also accepts an ambiguous semicolon (<code>;</code>) separated variation.  The colon form
is unambiguous and should be preferred; the semicolon form should not be used
by new applications and is not documented here in the interest of avoiding
accidental new implementations.</p>
<h5>CSI 38:5 - foreground color palette index</h5>
<p>This sequence will set the <em>foreground color</em> to the specified palette INDEX,
which can be a decimal number in the range <code>0-255</code>.</p>
<pre>CSI 38 : 5 : INDEX m
</pre>
<h5>CSI 48:5 - background color palette index</h5>
<p>This sequence will set the <em>background color</em> to the specified palette INDEX,
which can be a decimal number in the range <code>0-255</code>.</p>
<pre>CSI 48 : 5 : INDEX m
</pre>
<h5>CSI 58:5 - underline color palette index</h5>
<p>This sequence will set the <em>underline color</em> to the specified palette INDEX,
which can be a decimal number in the range <code>0-255</code>.</p>
<pre>CSI 58 : 5 : INDEX m
</pre>
<h5>CSI 38:2 - foreground color: RGB</h5>
<p>This sequence will set the <em>foreground color</em> to an arbitrary color in RGB
colorspace.  The <code>R</code>, <code>G</code> and <code>B</code> symbols below are decimal numbers in the
range <code>0-255</code>.  Note that after the <code>2</code> parameter two colons are present; its
really an omitted <em>colorspace ID</em> parameter but that nature of that parameter
is not specified in the accompanying ITU T.416 specification and is ignored by
<code>WezTerm</code> and most (all?) other terminal emulators:</p>
<pre>CSI 38 : 2 : : R : G : B m
</pre>
<p>(<em>Since 20210814-124438-54e29167</em>) For the sake of compatibility with some other
terminal emulators this additional form is also supported where the colorspace
ID argument is not specified:</p>
<pre>CSI 38 : 2 : R : G : B m
</pre>
<h5>CSI 38:6 - foreground color: RGBA</h5>
<p>{{since('20220807-113146-c2fee766')}}</p>
<p>This is a wezterm extension: wezterm considers color mode <code>6</code> as RGBA,
allowing you to specify the alpha channel in addition to the RGB channels.</p>
<pre>CSI 38 : 6 : : R : G : B : A m
</pre>
<h5>CSI 48:2 - background color: RGB</h5>
<p>This sequence will set the <em>background color</em> to an arbitrary color in RGB colorspace.
The <code>R</code>, <code>G</code> and <code>B</code> symbols below are decimal numbers in the range <code>0-255</code>:</p>
<pre>CSI 48 : 2 : : R : G : B m
</pre>
<p>(<em>Since 20210814-124438-54e29167</em>) For the sake of compatibility with some other
terminal emulators this additional form is also supported where the colorspace
ID argument is not specified:</p>
<pre>CSI 48 : 2 : R : G : B m
</pre>
<h5>CSI 48:6 - background color: RGBA</h5>
<p>{{since('20220807-113146-c2fee766')}}</p>
<p>This is a wezterm extension: wezterm considers color mode <code>6</code> as RGBA,
allowing you to specify the alpha channel in addition to the RGB channels.</p>
<pre>CSI 48 : 6 : : R : G : B : A m
</pre>
<h5>CSI 58:2 - underline color: RGB</h5>
<p>This sequence will set the <em>underline color</em> to an arbitrary color in RGB colorspace.
The <code>R</code>, <code>G</code> and <code>B</code> symbols below are decimal numbers in the range <code>0-255</code>:</p>
<pre>CSI 58 : 2 : : R : G : B m
</pre>
<p>(<em>Since 20210814-124438-54e29167</em>) For the sake of compatibility with some other
terminal emulators this additional form is also supported where the colorspace
ID argument is not specified:</p>
<pre>CSI 58 : 2 : R : G : B m
</pre>
<h5>CSI 58:6 - underline color: RGBA</h5>
<p>{{since('20220807-113146-c2fee766')}}</p>
<p>This is a wezterm extension: wezterm considers color mode <code>6</code> as RGBA,
allowing you to specify the alpha channel in addition to the RGB channels.</p>
<pre>CSI 58 : 6 : : R : G : B : A m
</pre>
<h4>Cursor Movement</h4>
<h4>Editing Functions</h4>
<h4>Mode Functions</h4>
<p>{{since('20210814-124438-54e29167')}}</p>
<p>WezTerm supports <a href="https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036">Synchronized Rendering</a>.
DECSET 2026 is set to batch (hold) rendering until DECSET 2026 is reset to flush the queued screen data.</p>
<h4>Device Functions</h4>
<h4>Window Functions</h4>
<h3>DCS - Device Control String</h3>
<p>The <code>C1</code> <code>DCS</code> escape places the terminal parser into a device control mode until the <code>C1</code> <code>ST</code> is encountered.</p>
<p>In the table below, <code>DCS</code> can be either the 7-bit representation (<code>ESC P</code>) or the 8-bit codepoint (<code>0x90</code>).</p>
<table><thead><tr><th>Seq</th><th>Name</th><th>Description</th></tr></thead><tbody>
<tr><td>DCS $ q " p ST</td><td><a href="https://vt100.net/docs/vt510-rm/DECRQSS.html">DECRQSS</a> for <a href="https://vt100.net/docs/vt510-rm/DECSCL.html">DECSCL</a></td><td>Request Conformance Level; Reports the conformance level</td></tr>
<tr><td>DCS $ q r ST</td><td><a href="https://vt100.net/docs/vt510-rm/DECRQSS.html">DECRQSS</a> for <a href="https://vt100.net/docs/vt510-rm/DECSTBM.html">DECSTBM</a></td><td>Request top and bottom margin report; Reports the margins</td></tr>
<tr><td>DCS $ q s ST</td><td><a href="https://vt100.net/docs/vt510-rm/DECRQSS.html">DECRQSS</a> for <a href="https://vt100.net/docs/vt510-rm/DECSLRM.html">DECSLRM</a></td><td>Request left and right margin report; Reports the margins</td></tr>
<tr><td>DCS [PARAMS] q [DATA] ST</td><td>Sixel Graphic Data</td><td>Decodes <a href="https://vt100.net/docs/vt3xx-gp/chapter14.html">Sixel graphic data</a> and apply the image to the terminal model. Support is preliminary and incomplete; see <a href="https://github.com/wezterm/wezterm/issues/217">this issue</a> for status.</td></tr>
<tr><td>DCS 1000 q</td><td>tmux control mode</td><td>Bridges tmux into the WezTerm multiplexer.  Currently incomplete, see <a href="https://github.com/wezterm/wezterm/issues/336">this issue</a> for status.</td></tr>
</tbody></table>
<h3>Operating System Command Sequences</h3>
<p>Operating System Command (OSC) sequences are introduced via <code>ESC ]</code> followed by
a numeric code and typically have parameters delimited by <code>;</code>.  OSC sequences
are canonically delimited by the <code>ST</code> (String Terminator) sequence, but WezTerm
also accepts delimiting them with the <code>BEL</code> control.</p>
<p>The table below is keyed by the OSC code.</p>
<table><thead><tr><th>OSC</th><th>Description</th><th>Action</th><th>Example</th></tr></thead><tbody>
<tr><td>0</td><td>Set Icon Name and Window Title</td><td>Clears Icon Name, sets Window Title.</td><td><code>\x1b]0;title\x1b\\</code></td></tr>
<tr><td>1</td><td>Set Icon Name</td><td>Sets Icon Name, which is used as the Tab title when it is non-empty</td><td><code>\x1b]1;tab-title\x1b\\</code></td></tr>
<tr><td>2</td><td>Set Window Title</td><td>Set Window Title</td><td><code>\x1b]2;window-title\x1b\\</code></td></tr>
<tr><td>3</td><td>Set X11 Window Property</td><td>Ignored</td><td></td></tr>
<tr><td>4</td><td>Change/Query Color Number</td><td>Set or query color palette entries 0-255.</td><td>query color number 1: <code>\x1b]4;1;?\x1b\\</code> &lt;br/&gt; Set color number 2: <code>\x1b]4;2;#cccccc\x1b\\</code></td></tr>
<tr><td>5</td><td>Change/Query Special Color Number</td><td>Ignored</td><td></td></tr>
<tr><td>6</td><td>iTerm2 Change Title Tab Color</td><td>Ignored</td><td></td></tr>
<tr><td>7</td><td>Set Current Working Directory</td><td><a href="/fork/wezterm/ref/termiz-0.23.3/blob/docs/shell-integration.md#osc-7-escape-sequence-to-set-the-working-directory">See Shell Integration</a></td><td></td></tr>
<tr><td>8</td><td>Set Hyperlink</td><td><a href="/fork/wezterm/ref/termiz-0.23.3/blob/docs/hyperlinks.md#explicit-hyperlinks">See Explicit Hyperlinks</a></td><td></td></tr>
<tr><td>9</td><td>iTerm2 Show System Notification</td><td>Show a "toast" notification</td><td><code>printf "\e]9;%s\e\\" "hello there"</code></td></tr>
<tr><td>10</td><td>Set Default Text Foreground Color</td><td></td><td><code>\x1b]10;#ff0000\x1b\\</code>.&lt;br/&gt; Also supports RGBA in nightly builds: <code>printf "\e]10;rgba(127,127,127,0.4)\x07"</code></td></tr>
<tr><td>11</td><td>Set Default Text Background Color</td><td></td><td><code>\x1b]11;#0000ff\x1b\\</code>.&lt;br/&gt; Also supports RGBA in nightly builds: <code>printf "\e]11;rgba:efff/ecff/f4ff/d000\x07"</code></td></tr>
<tr><td>12</td><td>Set Text Cursor Color</td><td></td><td><code>\x1b]12;#00ff00\x1b\\</code>.&lt;br/&gt; Also supports RGBA in nightly builds.</td></tr>
<tr><td>52</td><td>Manipulate clipboard</td><td>Requests to query the clipboard are ignored. Allows setting or clearing the clipboard</td><td></td></tr>
<tr><td>104</td><td>ResetColors</td><td>Reset color palette entries to their default values</td><td></td></tr>
<tr><td>133</td><td>FinalTerm semantic escapes</td><td>Informs the terminal about Input, Output and Prompt regions on the display</td><td><a href="/fork/wezterm/ref/termiz-0.23.3/blob/docs/shell-integration.md">See Shell Integration</a></td></tr>
<tr><td>777</td><td>Call rxvt extension</td><td>Only the notify extension is supported; it shows a "toast" notification</td><td><code>printf "\e]777;notify;%s;%s\e\\" "title" "body"</code></td></tr>
<tr><td>1337</td><td>iTerm2 File Upload Protocol</td><td>Allows displaying images inline</td><td><a href="/fork/wezterm/ref/termiz-0.23.3/blob/docs/imgcat.md">See iTerm Image Protocol</a></td></tr>
<tr><td>L</td><td>Set Icon Name (Sun)</td><td>Same as OSC 1</td><td><code>\x1b]Ltab-title\x1b\\</code></td></tr>
<tr><td>l</td><td>Set Window Title (Sun)</td><td>Same as OSC 2</td><td><code>\x1b]lwindow-title\x1b\\</code></td></tr>
</tbody></table>
<h1>Additional Resources</h1>
<ul>
<li><a href="http://invisible-island.net/xterm/ctlseqs/ctlseqs.txt">xterm's escape sequences</a></li>
<li><a href="https://iterm2.com/documentation-escape-codes.html">iTerm2's escape sequences</a></li>
<li><a href="https://sw.kovidgoyal.net/kitty/protocol-extensions.html">kitty's escape sequences</a></li>
<li><a href="https://github.com/billiob/terminology#extended-escapes-for-terminology-only">Terminology's escape sequences</a></li>
<li><a href="https://docs.google.com/spreadsheets/d/19W-lXWS9jYwqCK-LwgYo31GucPPxYVld_hVEcfpNpXg/edit?usp=sharing">This Google spreadsheet</a>
aims to document all the known escape sequences.</li>
<li><a href="https://en.wikipedia.org/wiki/ANSI_escape_code">Wikipedia's ANSI escape code page</a></li>
</ul>
</section><div class="code-panel"><pre class="code src language-markdown"><span class="code-line"><a class="ln" id="L1" href="#L1">1</a><span class="code-text"><a-p>&gt; </a-p>Please note that this is a &quot;living document&quot; and may lag or lead the state</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L2" href="#L2">2</a><span class="code-text"><a-p>&gt; </a-p>of the current stable release in a number of areas--as you might imagine,</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L3" href="#L3">3</a><span class="code-text"><a-p>&gt; </a-p>precisely documenting escape codes and their behaviors and cross-checking</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L4" href="#L4">4</a><span class="code-text"><a-p>&gt; </a-p>with the various technical documents is laborious and tedious and I only</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L5" href="#L5">5</a><span class="code-text"><a-p>&gt; </a-p>have so much spare time!</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L6" href="#L6">6</a><span class="code-text"><a-p>&gt;</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L7" href="#L7">7</a><span class="code-text"><a-p>&gt; </a-p>If you notice that something is inaccurate or missing, please do [file an issue](https://github.com/wezterm/wezterm/issues/new/choose)</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L8" href="#L8">8</a><span class="code-text"><a-p>&gt; </a-p>so that it can be resolved!</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L9" href="#L9">9</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L10" href="#L10">10</a><span class="code-text"><a-p>##</a-p> <a-tt>Output/Escape Sequences</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L11" href="#L11">11</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L12" href="#L12">12</a><span class="code-text">WezTerm considers the output from the terminal to be a UTF-8 encoded stream of</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L13" href="#L13">13</a><span class="code-text">codepoints.  No other encoding is supported.  As described below, some C1</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L14" href="#L14">14</a><span class="code-text">control codes have both 7-bit ASCII compatible as well as 8-bit</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L15" href="#L15">15</a><span class="code-text">representations.  As ASCII is a compatible subset of UTF-8, the 7-bit</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L16" href="#L16">16</a><span class="code-text">representations are preferred and processed without any special consideration.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L17" href="#L17">17</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L18" href="#L18">18</a><span class="code-text">The 8-bit values *are* recognized, but only if the 8-bit value is treated as a</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L19" href="#L19">19</a><span class="code-text">unicode code point and encoded via a UTF-8 multi-byte sequence.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L20" href="#L20">20</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L21" href="#L21">21</a><span class="code-text"><a-p>###</a-p> <a-tt>Printable Codepoints</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L22" href="#L22">22</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L23" href="#L23">23</a><span class="code-text">Codepoints with value 0x20 and higher are considered to be printable and are</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L24" href="#L24">24</a><span class="code-text">applied to the terminal display using the following rules:</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L25" href="#L25">25</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L26" href="#L26">26</a><span class="code-text"><a-p>* </a-p>Codepoints are buffered until a C0, C1 or other escape/control sequence is encountered,</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L27" href="#L27">27</a><span class="code-text"><a-p>  </a-p>which triggers a flush and processing continues with the next step.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L28" href="#L28">28</a><span class="code-text"><a-p>* </a-p>The buffered codepoint sequence is split into unicode graphemes, which means that</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L29" href="#L29">29</a><span class="code-text"><a-p>  </a-p>combining sequences and emoji are decoded.  Processing continues for below for</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L30" href="#L30">30</a><span class="code-text"><a-p>  </a-p>each individually recognized grapheme.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L31" href="#L31">31</a><span class="code-text"><a-p>* </a-p>If DEC line drawing mode is active, graphemes `j-n`, `q`, `t-x` are translated</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L32" href="#L32">32</a><span class="code-text"><a-p>  </a-p>to equivalent line drawing graphemes and processing continues.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L33" href="#L33">33</a><span class="code-text"><a-p>* </a-p>If prior output/actions require it, the cursor position may be moved to a new line</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L34" href="#L34">34</a><span class="code-text"><a-p>  </a-p>and the terminal display may be scrolled to make accommodate it.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L35" href="#L35">35</a><span class="code-text"><a-p>* </a-p>An appropriate number of cells, starting at the current cursor position,</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L36" href="#L36">36</a><span class="code-text"><a-p>  </a-p>are allocated based on the column width of the current grapheme and are assigned</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L37" href="#L37">37</a><span class="code-text"><a-p>  </a-p>to the grapheme.  The current current graphics rendition state (such as colors</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L38" href="#L38">38</a><span class="code-text"><a-p>  </a-p>and other presentation attributes) is also applied to those cells.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L39" href="#L39">39</a><span class="code-text"><a-p>  </a-p>If insert mode is active, those cells will be inserted at the current cursor</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L40" href="#L40">40</a><span class="code-text"><a-p>  </a-p>position, otherwise they will overwrite cells at the current cursor position.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L41" href="#L41">41</a><span class="code-text"><a-p>* </a-p>The cursor position will be updated based on the column width of the grapheme.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L42" href="#L42">42</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L43" href="#L43">43</a><span class="code-text"><a-p>After the graphemes are applied to the terminal display, the rendering portion of</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L44" href="#L44">44</a><span class="code-text"><a-p>WezTerm will attempt to apply your [font shaping](config/font-shaping.md) configuration</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L45" href="#L45">45</a><span class="code-text"><a-p>based on runs of graphemes with matching graphic attributes to determine which glyphs</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L46" href="#L46">46</a><span class="code-text"><a-p>should be rendered from your fonts; it is at this stage that emoji and ligatures are</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L47" href="#L47">47</a><span class="code-text"><a-p>resolved.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L48" href="#L48">48</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L49" href="#L49">49</a><span class="code-text"><a-p>### </a-p><a-tt>C0 Control Codes</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L50" href="#L50">50</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L51" href="#L51">51</a><span class="code-text"><a-p>Codepoints in the range `0x00-0x1F` are considered to be `C0` control codes.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L52" href="#L52">52</a><span class="code-text"><a-p>`C0` controls will flush any buffered printable codepoints before triggering</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L53" href="#L53">53</a><span class="code-text"><a-p>the action described below.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L54" href="#L54">54</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L55" href="#L55">55</a><span class="code-text"><a-p>| Seq|Hex |Name|Description|Action |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L56" href="#L56">56</a><span class="code-text"><a-p>|----|----|----|-----------|------ |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L57" href="#L57">57</a><span class="code-text"><a-p>| ^@ |0x00|NUL |Null       |Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L58" href="#L58">58</a><span class="code-text"><a-p>| ^A |0x01|SOH |Start of Heading|Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L59" href="#L59">59</a><span class="code-text"><a-p>| ^B |0x02|STX |Start of Text|Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L60" href="#L60">60</a><span class="code-text"><a-p>| ^C |0x03|ETX |End of Text|Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L61" href="#L61">61</a><span class="code-text"><a-p>| ^D |0x04|EOT |End of Transmission|Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L62" href="#L62">62</a><span class="code-text"><a-p>| ^E |0x05|ENQ |Enquiry    |Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L63" href="#L63">63</a><span class="code-text"><a-p>| ^F |0x06|ACK |Acknowledge|Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L64" href="#L64">64</a><span class="code-text"><a-p>| ^G |0x07|BEL |Bell       |Logs `Ding! (this is the bell)` to stderr of the WezTerm process. See [#3](https://github.com/wezterm/wezterm/issues/3)|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L65" href="#L65">65</a><span class="code-text"><a-p>| ^H |0x08|BS  |Backspace  |Move cursor left by 1, constrained by the left margin. If Reverse Wraparound and dec auto wrap modes are enabled, moving left of the left margin will jump the cursor to the right margin, jumping to bottom right margin if it was at the top left.|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L66" href="#L66">66</a><span class="code-text"><a-p>| ^I |0x09|HT  |Horizontal Tab|Move cursor right to the next tab stop|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L67" href="#L67">67</a><span class="code-text"><a-p>| ^J |0x0A|LF  |Line Feed  |If cursor is at the bottom margin, scroll the region up, otherwise move cursor down 1 row|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L68" href="#L68">68</a><span class="code-text"><a-p>| ^K |0x0B|VT  |Vertical Tab|Treated as Line Feed|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L69" href="#L69">69</a><span class="code-text"><a-p>| ^L |0x0C|FF  |Form Feed   |Treated as Line Feed|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L70" href="#L70">70</a><span class="code-text"><a-p>| ^M |0x0D|CR  |Carriage Return|If cursor is left of leftmost margin, move to column 0. Otherwise move to left margin|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L71" href="#L71">71</a><span class="code-text"><a-p>| ^N |0x0E|SO  |Shift Out   |Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L72" href="#L72">72</a><span class="code-text"><a-p>| ^O |0x0F|SI  |Shift In    |Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L73" href="#L73">73</a><span class="code-text"><a-p>| ^P |0x10|DLE |Data Link Escape|Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L74" href="#L74">74</a><span class="code-text"><a-p>| ^Q |0x11|DC1 |Device Control One|Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L75" href="#L75">75</a><span class="code-text"><a-p>| ^R |0x12|DC2 |Device Control Two|Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L76" href="#L76">76</a><span class="code-text"><a-p>| ^S |0x13|DC3 |Device Control Three|Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L77" href="#L77">77</a><span class="code-text"><a-p>| ^T |0x14|DC4 |Device Control Four|Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L78" href="#L78">78</a><span class="code-text"><a-p>| ^U |0x15|NAK |Negative Acknowledge|Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L79" href="#L79">79</a><span class="code-text"><a-p>| ^V |0x16|SYN |Synchronous Idle|Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L80" href="#L80">80</a><span class="code-text"><a-p>| ^W |0x17|ETB |End Transmission Block|Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L81" href="#L81">81</a><span class="code-text"><a-p>| ^X |0x18|CAN |Cancel       |Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L82" href="#L82">82</a><span class="code-text"><a-p>| ^Y |0x19|EM  |End of Medium|Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L83" href="#L83">83</a><span class="code-text"><a-p>| ^Z |0x1A|SUB |Substitute   |Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L84" href="#L84">84</a><span class="code-text"><a-p>| ^\[ |0x1B|ESC |Escape       |Introduces various escape sequences described below|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L85" href="#L85">85</a><span class="code-text"><a-p>| ^\\|0x1C|FS  |File Separator|Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L86" href="#L86">86</a><span class="code-text"><a-p>| ^] |0x1D|GS  |Group Separator|Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L87" href="#L87">87</a><span class="code-text"><a-p>| ^^ |0x1E|RS  |Record Separator|Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L88" href="#L88">88</a><span class="code-text"><a-p>| ^_ |0x1F|US  |Unit Separator|Ignored|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L89" href="#L89">89</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L90" href="#L90">90</a><span class="code-text"><a-p>### </a-p><a-tt>C1 Control Codes</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L91" href="#L91">91</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L92" href="#L92">92</a><span class="code-text"><a-p>As mentioned above, WezTerm only supports UTF-8 encoding.  C1 control codes</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L93" href="#L93">93</a><span class="code-text"><a-p>have an 8-bit representation as well as a multi-codepoint 7-bit escape sequence.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L94" href="#L94">94</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L95" href="#L95">95</a><span class="code-text"><a-p>The 8-bit representation is recognized if the 8-bit value is treated as a</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L96" href="#L96">96</a><span class="code-text"><a-p>unicode code point and encoded as a multi-byte UTF-8 sequence.  Sending the</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L97" href="#L97">97</a><span class="code-text"><a-p>8-bit binary value will not be recognized as intended, as those bitsequences</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L98" href="#L98">98</a><span class="code-text"><a-p>are passing through a UTF-8 decoder.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L99" href="#L99">99</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L100" href="#L100">100</a><span class="code-text"><a-p>The table below lists the 7-bit `C1` sequence (which is preferred) as well as the</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L101" href="#L101">101</a><span class="code-text"><a-p>codepoint value, along with the corresponding meaning.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L102" href="#L102">102</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L103" href="#L103">103</a><span class="code-text"><a-p>As with `C0` control codes, `C1` controls will flush any buffered printable</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L104" href="#L104">104</a><span class="code-text"><a-p>codepoints before triggering the action described below.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L105" href="#L105">105</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L106" href="#L106">106</a><span class="code-text"><a-p>|Seq   |Codepoint|Name|Description       |Action|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L107" href="#L107">107</a><span class="code-text"><a-p>|----- |---------|----|------------------|------|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L108" href="#L108">108</a><span class="code-text"><a-p>|ESC D |0x84     |IND |Index             |Moves the cursor down one line in the same column. If the cursor is at the bottom margin, the page scrolls up|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L109" href="#L109">109</a><span class="code-text"><a-p>|ESC E |0x85     |NEL |Next Line         |Moves the cursor to the left margin on the next line. If the cursor is at the bottom margin, scroll the page up|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L110" href="#L110">110</a><span class="code-text"><a-p>|ESC H |0x88     |HTS |Horizontal Tab Set|Sets a horizontal tab stop at the column where the cursor is|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L111" href="#L111">111</a><span class="code-text"><a-p>|ESC M |0x8D     |RI  |Reverse Index     |Move the cursor up one line. If the cursor is at the top margin, scroll the region down|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L112" href="#L112">112</a><span class="code-text"><a-p>|ESC P |0x90     |DCS |Device Control String|Discussed below|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L113" href="#L113">113</a><span class="code-text"><a-p>|ESC [ |0x9B     |CSI |Control Sequence Introducer|Discussed below|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L114" href="#L114">114</a><span class="code-text"><a-p>|ESC \\|0x9C     |ST  |String Terminator |No direct effect; ST is used to delimit the end of OSC style escape sequences|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L115" href="#L115">115</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L116" href="#L116">116</a><span class="code-text"><a-p>### </a-p><a-tt>Other Escape Sequences</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L117" href="#L117">117</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L118" href="#L118">118</a><span class="code-text"><a-p>As these sequences start with an `ESC`, which is a `C0` control, these will</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L119" href="#L119">119</a><span class="code-text"><a-p>flush any buffered printable codepoints before triggering the associated</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L120" href="#L120">120</a><span class="code-text"><a-p>action.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L121" href="#L121">121</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L122" href="#L122">122</a><span class="code-text"><a-p>|Seq    | Name   | Description         | Action |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L123" href="#L123">123</a><span class="code-text"><a-p>|-------|--------|---------------------|--------|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L124" href="#L124">124</a><span class="code-text"><a-p>|ESC c  | [RIS](https://vt100.net/docs/vt510-rm/RIS.html) | Reset to Initial State | Resets tab stops, margins, modes, graphic rendition, palette, activates primary screen, erases the display and moves cursor to home position |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L125" href="#L125">125</a><span class="code-text"><a-p>|ESC 7  | [DECSC](https://vt100.net/docs/vt510-rm/DECSC.html)  | Save Cursor Position| Records cursor position |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L126" href="#L126">126</a><span class="code-text"><a-p>|ESC 8  | [DECRC](https://vt100.net/docs/vt510-rm/DECRC.html)  | Restored Saved Cursor Position | Moves cursor to location it had when DECSC was used |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L127" href="#L127">127</a><span class="code-text"><a-p>|ESC =  | [DECPAM](https://vt100.net/docs/vt510-rm/DECPAM.html) | Application Keypad  | Enable Application Keypad Mode |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L128" href="#L128">128</a><span class="code-text"><a-p>|ESC &gt;  | [DECPNM](https://vt100.net/docs/vt510-rm/DECPNM.html) | Normal Keypad       | Set Normal Keypad Mode |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L129" href="#L129">129</a><span class="code-text"><a-p>|ESC (0 |        | DEC Line Drawing character set | Translate characters `j-x` to line drawing glyphs |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L130" href="#L130">130</a><span class="code-text"><a-p>|ESC (B |        | US ASCII character set | Disables DEC Line Drawing character translation |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L131" href="#L131">131</a><span class="code-text"><a-p>|ESC #8 | [DECALN](https://vt100.net/docs/vt510-rm/DECALN.html) | Screen Alignment Display | Fills the display with `E` characters for diagnostic/test purposes (for vttest) |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L132" href="#L132">132</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L133" href="#L133">133</a><span class="code-text"><a-p>### </a-p><a-tt>CSI - Control Sequence Introducer Sequences</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L134" href="#L134">134</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L135" href="#L135">135</a><span class="code-text"><a-p>CSI sequences begin with the `C1` `CSI` sequence, which is either the 7-bit</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L136" href="#L136">136</a><span class="code-text"><a-p>`ESC [` sequence or the codepoint `0x9B`.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L137" href="#L137">137</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L138" href="#L138">138</a><span class="code-text"><a-p>WezTerm classifies these sequences into a number of functional families which</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L139" href="#L139">139</a><span class="code-text"><a-p>are broken out below.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L140" href="#L140">140</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L141" href="#L141">141</a><span class="code-text"><a-p>#### </a-p><a-tt>Graphic Rendition (SGR)</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L142" href="#L142">142</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L143" href="#L143">143</a><span class="code-text"><a-p>SGR sequences are of the form `CSI DIGITS [; DIGITS ]+ m`.  That is, any number</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L144" href="#L144">144</a><span class="code-text"><a-p>of semicolon separated numbers, terminated by the `m` codepoint.  There are a handful</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L145" href="#L145">145</a><span class="code-text"><a-p>of slightly more modern sequences that use colon `:` codepoints to encode additional</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L146" href="#L146">146</a><span class="code-text"><a-p>context.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L147" href="#L147">147</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L148" href="#L148">148</a><span class="code-text"><a-p>The digits map to one of the codes in the table below, which manipulate the</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L149" href="#L149">149</a><span class="code-text"><a-p>presentation attributes of subsequently printed characters.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L150" href="#L150">150</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L151" href="#L151">151</a><span class="code-text"><a-p>It is valid to omit the code number; for example `CSI m` is equivalent to `CSI</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L152" href="#L152">152</a><span class="code-text"><a-p>0 m` which resets the presentation attributes.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L153" href="#L153">153</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L154" href="#L154">154</a><span class="code-text"><a-p>|Code|Description|Action|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L155" href="#L155">155</a><span class="code-text"><a-p>|--- |-----------|------|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L156" href="#L156">156</a><span class="code-text"><a-p>|0   |Reset      |Reset to default foreground/background colors, reset all presentation attributes, clear any explicit hyperlinks| </a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L157" href="#L157">157</a><span class="code-text"><a-p>|1   |IntensityBold|Set the intensity level to Bold.  This causes subsequent text to be rendered in a bold font variant and, if the foreground color is set to a palette index in the 0-7 range, effectively shifts it to the brighter value in the 8-15 range|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L158" href="#L158">158</a><span class="code-text"><a-p>|2   |IntensityDim|Set the intensity level to Dim or Half-Bright.  This causes text to be rendered in a lighter weight font variant|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L159" href="#L159">159</a><span class="code-text"><a-p>|3   |ItalicOn|Sets the italic attribute on the text, causing an italic font variant to be selected|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L160" href="#L160">160</a><span class="code-text"><a-p>|4   |UnderlineOn|Text will have a single underline|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L161" href="#L161">161</a><span class="code-text"><a-p>|4:0 |UnderlineOff|Text will have no underline|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L162" href="#L162">162</a><span class="code-text"><a-p>|4:1 |UnderlineOn|Text will have a single underline|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L163" href="#L163">163</a><span class="code-text"><a-p>|4:2 |UnderlineDouble|Text will be rendered with double underline|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L164" href="#L164">164</a><span class="code-text"><a-p>|4:3 |UnderlineCurly|Text will be rendered with a curly underline|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L165" href="#L165">165</a><span class="code-text"><a-p>|4:4 |UnderlineDotted|Text will be rendered with a dotted underline|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L166" href="#L166">166</a><span class="code-text"><a-p>|4:5 |UnderlineDashed|Text will be rendered with a dashed underline|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L167" href="#L167">167</a><span class="code-text"><a-p>|5   |BlinkOn|Indicates that the text should blink &lt;150 times per minute|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L168" href="#L168">168</a><span class="code-text"><a-p>|6   |RapidBlinkOn|Indicates that the text should blink &gt;150 times per minute|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L169" href="#L169">169</a><span class="code-text"><a-p>|7   |InverseOn|Causes the foreground and background colors to be swapped|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L170" href="#L170">170</a><span class="code-text"><a-p>|8   |InvisibleOn|Marks text as invisible.|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L171" href="#L171">171</a><span class="code-text"><a-p>|9   |StrikeThroughOn|Text will be rendered with a single line struck through the middle|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L172" href="#L172">172</a><span class="code-text"><a-p>|21  |UnderlineDouble|Text will be rendered with double underline|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L173" href="#L173">173</a><span class="code-text"><a-p>|22  |NormalIntensity|Cancels the effect of IntensityBold and IntensityDim, returning the text to normal intensity|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L174" href="#L174">174</a><span class="code-text"><a-p>|23  |ItalicOff|Cancels the effect of ItalicOn|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L175" href="#L175">175</a><span class="code-text"><a-p>|24  |UnderlineOff|Text will have no underline|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L176" href="#L176">176</a><span class="code-text"><a-p>|25  |BlinkOff|Cancels the effect of BlinkOn and RapidBlinkOn|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L177" href="#L177">177</a><span class="code-text"><a-p>|27  |InverseOff|Cancels the effect of InverseOn|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L178" href="#L178">178</a><span class="code-text"><a-p>|28  |InvisibleOff|cancels the effect of InvisibleOn|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L179" href="#L179">179</a><span class="code-text"><a-p>|29  |StrikeThroughOff|Cancels the effect of StrikeThroughOn|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L180" href="#L180">180</a><span class="code-text"><a-p>|30  |ForegroundBlack|Sets the foreground color to ANSI Black, which is palette index 0|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L181" href="#L181">181</a><span class="code-text"><a-p>|31  |ForegroundRed|Sets the foreground color to ANSI Red, which is palette index 1|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L182" href="#L182">182</a><span class="code-text"><a-p>|32  |ForegroundGreen|Sets the foreground color to ANSI Green, which is palette index 2|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L183" href="#L183">183</a><span class="code-text"><a-p>|33  |ForegroundYellow|Sets the foreground color to ANSI Yellow, which is palette index 3|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L184" href="#L184">184</a><span class="code-text"><a-p>|34  |ForegroundBlue|Sets the foreground color to ANSI Blue, which is palette index 4|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L185" href="#L185">185</a><span class="code-text"><a-p>|35  |ForegroundMagenta|Sets the foreground color to ANSI Magenta, which is palette index 5|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L186" href="#L186">186</a><span class="code-text"><a-p>|36  |ForegroundCyan|Sets the foreground color to ANSI Cyan, which is palette index 6|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L187" href="#L187">187</a><span class="code-text"><a-p>|37  |ForegroundWhite|Sets the foreground color to ANSI White, which is palette index 7|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L188" href="#L188">188</a><span class="code-text"><a-p>|39  |ForegroundDefault|Sets the foreground color to the user&#39;s configured default text color|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L189" href="#L189">189</a><span class="code-text"><a-p>|40  |BackgroundBlack|Sets the background color to ANSI Black, which is palette index 0|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L190" href="#L190">190</a><span class="code-text"><a-p>|41  |BackgroundRed|Sets the background color to ANSI Red, which is palette index 1|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L191" href="#L191">191</a><span class="code-text"><a-p>|42  |BackgroundGreen|Sets the background color to ANSI Green, which is palette index 2|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L192" href="#L192">192</a><span class="code-text"><a-p>|43  |BackgroundYellow|Sets the background color to ANSI Yellow, which is palette index 3|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L193" href="#L193">193</a><span class="code-text"><a-p>|44  |BackgroundBlue|Sets the background color to ANSI Blue, which is palette index 4|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L194" href="#L194">194</a><span class="code-text"><a-p>|45  |BackgroundMagenta|Sets the background color to ANSI Magenta, which is palette index 5|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L195" href="#L195">195</a><span class="code-text"><a-p>|46  |BackgroundCyan|Sets the background color to ANSI Cyan, which is palette index 6|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L196" href="#L196">196</a><span class="code-text"><a-p>|47  |BackgroundWhite|Sets the background color to ANSI White, which is palette index 7|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L197" href="#L197">197</a><span class="code-text"><a-p>|49  |BackgroundDefault|Sets the background color to the user&#39;s configured default background color|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L198" href="#L198">198</a><span class="code-text"><a-p>|53  |OverlineOn|Renders text with a single overline/overbar|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L199" href="#L199">199</a><span class="code-text"><a-p>|55  |OverlineOff|Cancels OverlineOn|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L200" href="#L200">200</a><span class="code-text"><a-p>|59  |UnderlineColorDefault|Resets the underline color to default, which is to match the foreground color|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L201" href="#L201">201</a><span class="code-text"><a-p>|73  |VerticalAlignSuperScript|Adjusts the baseline of the text so that it renders as superscript {{since(&#39;20221119-145034-49b9839f&#39;, inline=True)}}|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L202" href="#L202">202</a><span class="code-text"><a-p>|74  |VerticalAlignSubScript|Adjusts the baseline of the text so that it renders as subscript {{since(&#39;20221119-145034-49b9839f&#39;, inline=True)}}|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L203" href="#L203">203</a><span class="code-text"><a-p>|75  |VerticalAlignBaseLine|Reset the baseline of the text to normal {{since(&#39;20221119-145034-49b9839f&#39;, inline=True)}}|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L204" href="#L204">204</a><span class="code-text"><a-p>|90  |ForegroundBrightBlack|Sets the foreground color to Bright Black, which is palette index 8|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L205" href="#L205">205</a><span class="code-text"><a-p>|91  |ForegroundBrightRed|Sets the foreground color to Bright Red, which is palette index 9|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L206" href="#L206">206</a><span class="code-text"><a-p>|92  |ForegroundBrightGreen|Sets the foreground color to Bright Green, which is palette index 10|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L207" href="#L207">207</a><span class="code-text"><a-p>|93  |ForegroundBrightYellow|Sets the foreground color to Bright Yellow, which is palette index 11|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L208" href="#L208">208</a><span class="code-text"><a-p>|94  |ForegroundBrightBlue|Sets the foreground color to Bright Blue, which is palette index 12|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L209" href="#L209">209</a><span class="code-text"><a-p>|95  |ForegroundBrightMagenta|Sets the foreground color to Bright Magenta, which is palette index 13|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L210" href="#L210">210</a><span class="code-text"><a-p>|96  |ForegroundBrightCyan|Sets the foreground color to Bright Cyan, which is palette index 14|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L211" href="#L211">211</a><span class="code-text"><a-p>|97  |ForegroundBrightWhite|Sets the foreground color to Bright White, which is palette index 15|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L212" href="#L212">212</a><span class="code-text"><a-p>|100  |BackgroundBrightBlack|Sets the background color to Bright Black, which is palette index 8|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L213" href="#L213">213</a><span class="code-text"><a-p>|101  |BackgroundBrightRed|Sets the background color to Bright Red, which is palette index 9|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L214" href="#L214">214</a><span class="code-text"><a-p>|102  |BackgroundBrightGreen|Sets the background color to Bright Green, which is palette index 10|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L215" href="#L215">215</a><span class="code-text"><a-p>|103  |BackgroundBrightYellow|Sets the background color to Bright Yellow, which is palette index 11|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L216" href="#L216">216</a><span class="code-text"><a-p>|104  |BackgroundBrightBlue|Sets the background color to Bright Blue, which is palette index 12|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L217" href="#L217">217</a><span class="code-text"><a-p>|105  |BackgroundBrightMagenta|Sets the background color to Bright Magenta, which is palette index 13|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L218" href="#L218">218</a><span class="code-text"><a-p>|106  |BackgroundBrightCyan|Sets the background color to Bright Cyan, which is palette index 14|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L219" href="#L219">219</a><span class="code-text"><a-p>|107  |BackgroundBrightWhite|Sets the background color to Bright White, which is palette index 15|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L220" href="#L220">220</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L221" href="#L221">221</a><span class="code-text"><a-p>There are a handful of additional SGR codes that allow setting extended colors;</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L222" href="#L222">222</a><span class="code-text"><a-p>unlike the codes above, which are activated by a single numeric parameter out</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L223" href="#L223">223</a><span class="code-text"><a-p>of SGR sequence, these the extended color codes require multiple parameters.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L224" href="#L224">224</a><span class="code-text"><a-p>The canonical representation of these sequences is to have the multiple</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L225" href="#L225">225</a><span class="code-text"><a-p>parameters be separated by colons (`:`), but for compatibility reasons WezTerm</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L226" href="#L226">226</a><span class="code-text"><a-p>also accepts an ambiguous semicolon (`;`) separated variation.  The colon form</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L227" href="#L227">227</a><span class="code-text"><a-p>is unambiguous and should be preferred; the semicolon form should not be used</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L228" href="#L228">228</a><span class="code-text"><a-p>by new applications and is not documented here in the interest of avoiding</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L229" href="#L229">229</a><span class="code-text"><a-p>accidental new implementations.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L230" href="#L230">230</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L231" href="#L231">231</a><span class="code-text"><a-p>##### </a-p><a-tt>CSI 38:5 - foreground color palette index</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L232" href="#L232">232</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L233" href="#L233">233</a><span class="code-text"><a-p>This sequence will set the *foreground color* to the specified palette INDEX,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L234" href="#L234">234</a><span class="code-text"><a-p>which can be a decimal number in the range `0-255`.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L235" href="#L235">235</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L236" href="#L236">236</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L237" href="#L237">237</a><span class="code-text"><a-p>CSI 38 : 5 : INDEX m</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L238" href="#L238">238</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L239" href="#L239">239</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L240" href="#L240">240</a><span class="code-text"><a-p>##### </a-p><a-tt>CSI 48:5 - background color palette index</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L241" href="#L241">241</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L242" href="#L242">242</a><span class="code-text"><a-p>This sequence will set the *background color* to the specified palette INDEX,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L243" href="#L243">243</a><span class="code-text"><a-p>which can be a decimal number in the range `0-255`.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L244" href="#L244">244</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L245" href="#L245">245</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L246" href="#L246">246</a><span class="code-text"><a-p>CSI 48 : 5 : INDEX m</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L247" href="#L247">247</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L248" href="#L248">248</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L249" href="#L249">249</a><span class="code-text"><a-p>##### </a-p><a-tt>CSI 58:5 - underline color palette index</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L250" href="#L250">250</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L251" href="#L251">251</a><span class="code-text"><a-p>This sequence will set the *underline color* to the specified palette INDEX,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L252" href="#L252">252</a><span class="code-text"><a-p>which can be a decimal number in the range `0-255`.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L253" href="#L253">253</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L254" href="#L254">254</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L255" href="#L255">255</a><span class="code-text"><a-p>CSI 58 : 5 : INDEX m</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L256" href="#L256">256</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L257" href="#L257">257</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L258" href="#L258">258</a><span class="code-text"><a-p>##### </a-p><a-tt>CSI 38:2 - foreground color: RGB</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L259" href="#L259">259</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L260" href="#L260">260</a><span class="code-text"><a-p>This sequence will set the *foreground color* to an arbitrary color in RGB</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L261" href="#L261">261</a><span class="code-text"><a-p>colorspace.  The `R`, `G` and `B` symbols below are decimal numbers in the</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L262" href="#L262">262</a><span class="code-text"><a-p>range `0-255`.  Note that after the `2` parameter two colons are present; its</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L263" href="#L263">263</a><span class="code-text"><a-p>really an omitted *colorspace ID* parameter but that nature of that parameter</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L264" href="#L264">264</a><span class="code-text"><a-p>is not specified in the accompanying ITU T.416 specification and is ignored by</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L265" href="#L265">265</a><span class="code-text"><a-p>`WezTerm` and most (all?) other terminal emulators:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L266" href="#L266">266</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L267" href="#L267">267</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L268" href="#L268">268</a><span class="code-text"><a-p>CSI 38 : 2 : : R : G : B m</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L269" href="#L269">269</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L270" href="#L270">270</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L271" href="#L271">271</a><span class="code-text"><a-p>(*Since 20210814-124438-54e29167*) For the sake of compatibility with some other</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L272" href="#L272">272</a><span class="code-text"><a-p>terminal emulators this additional form is also supported where the colorspace</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L273" href="#L273">273</a><span class="code-text"><a-p>ID argument is not specified:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L274" href="#L274">274</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L275" href="#L275">275</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L276" href="#L276">276</a><span class="code-text"><a-p>CSI 38 : 2 : R : G : B m</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L277" href="#L277">277</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L278" href="#L278">278</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L279" href="#L279">279</a><span class="code-text"><a-p>##### </a-p><a-tt>CSI 38:6 - foreground color: RGBA</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L280" href="#L280">280</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L281" href="#L281">281</a><span class="code-text"><a-p>{{since(&#39;20220807-113146-c2fee766&#39;)}}</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L282" href="#L282">282</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L283" href="#L283">283</a><span class="code-text"><a-p>This is a wezterm extension: wezterm considers color mode `6` as RGBA,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L284" href="#L284">284</a><span class="code-text"><a-p>allowing you to specify the alpha channel in addition to the RGB channels.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L285" href="#L285">285</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L286" href="#L286">286</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L287" href="#L287">287</a><span class="code-text"><a-p>CSI 38 : 6 : : R : G : B : A m</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L288" href="#L288">288</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L289" href="#L289">289</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L290" href="#L290">290</a><span class="code-text"><a-p>##### </a-p><a-tt>CSI 48:2 - background color: RGB</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L291" href="#L291">291</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L292" href="#L292">292</a><span class="code-text"><a-p>This sequence will set the *background color* to an arbitrary color in RGB colorspace.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L293" href="#L293">293</a><span class="code-text"><a-p>The `R`, `G` and `B` symbols below are decimal numbers in the range `0-255`:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L294" href="#L294">294</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L295" href="#L295">295</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L296" href="#L296">296</a><span class="code-text"><a-p>CSI 48 : 2 : : R : G : B m</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L297" href="#L297">297</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L298" href="#L298">298</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L299" href="#L299">299</a><span class="code-text"><a-p>(*Since 20210814-124438-54e29167*) For the sake of compatibility with some other</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L300" href="#L300">300</a><span class="code-text"><a-p>terminal emulators this additional form is also supported where the colorspace</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L301" href="#L301">301</a><span class="code-text"><a-p>ID argument is not specified:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L302" href="#L302">302</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L303" href="#L303">303</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L304" href="#L304">304</a><span class="code-text"><a-p>CSI 48 : 2 : R : G : B m</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L305" href="#L305">305</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L306" href="#L306">306</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L307" href="#L307">307</a><span class="code-text"><a-p>##### </a-p><a-tt>CSI 48:6 - background color: RGBA</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L308" href="#L308">308</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L309" href="#L309">309</a><span class="code-text"><a-p>{{since(&#39;20220807-113146-c2fee766&#39;)}}</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L310" href="#L310">310</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L311" href="#L311">311</a><span class="code-text"><a-p>This is a wezterm extension: wezterm considers color mode `6` as RGBA,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L312" href="#L312">312</a><span class="code-text"><a-p>allowing you to specify the alpha channel in addition to the RGB channels.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L313" href="#L313">313</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L314" href="#L314">314</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L315" href="#L315">315</a><span class="code-text"><a-p>CSI 48 : 6 : : R : G : B : A m</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L316" href="#L316">316</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L317" href="#L317">317</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L318" href="#L318">318</a><span class="code-text"><a-p>##### </a-p><a-tt>CSI 58:2 - underline color: RGB</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L319" href="#L319">319</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L320" href="#L320">320</a><span class="code-text"><a-p>This sequence will set the *underline color* to an arbitrary color in RGB colorspace.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L321" href="#L321">321</a><span class="code-text"><a-p>The `R`, `G` and `B` symbols below are decimal numbers in the range `0-255`:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L322" href="#L322">322</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L323" href="#L323">323</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L324" href="#L324">324</a><span class="code-text"><a-p>CSI 58 : 2 : : R : G : B m</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L325" href="#L325">325</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L326" href="#L326">326</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L327" href="#L327">327</a><span class="code-text"><a-p>(*Since 20210814-124438-54e29167*) For the sake of compatibility with some other</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L328" href="#L328">328</a><span class="code-text"><a-p>terminal emulators this additional form is also supported where the colorspace</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L329" href="#L329">329</a><span class="code-text"><a-p>ID argument is not specified:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L330" href="#L330">330</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L331" href="#L331">331</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L332" href="#L332">332</a><span class="code-text"><a-p>CSI 58 : 2 : R : G : B m</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L333" href="#L333">333</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L334" href="#L334">334</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L335" href="#L335">335</a><span class="code-text"><a-p>##### </a-p><a-tt>CSI 58:6 - underline color: RGBA</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L336" href="#L336">336</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L337" href="#L337">337</a><span class="code-text"><a-p>{{since(&#39;20220807-113146-c2fee766&#39;)}}</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L338" href="#L338">338</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L339" href="#L339">339</a><span class="code-text"><a-p>This is a wezterm extension: wezterm considers color mode `6` as RGBA,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L340" href="#L340">340</a><span class="code-text"><a-p>allowing you to specify the alpha channel in addition to the RGB channels.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L341" href="#L341">341</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L342" href="#L342">342</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L343" href="#L343">343</a><span class="code-text"><a-p>CSI 58 : 6 : : R : G : B : A m</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L344" href="#L344">344</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L345" href="#L345">345</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L346" href="#L346">346</a><span class="code-text"><a-p>#### </a-p><a-tt>Cursor Movement</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L347" href="#L347">347</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L348" href="#L348">348</a><span class="code-text"><a-p>#### </a-p><a-tt>Editing Functions</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L349" href="#L349">349</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L350" href="#L350">350</a><span class="code-text"><a-p>#### </a-p><a-tt>Mode Functions</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L351" href="#L351">351</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L352" href="#L352">352</a><span class="code-text"><a-p>{{since(&#39;20210814-124438-54e29167&#39;)}}</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L353" href="#L353">353</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L354" href="#L354">354</a><span class="code-text"><a-p>WezTerm supports [Synchronized Rendering](https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036).</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L355" href="#L355">355</a><span class="code-text"><a-p>DECSET 2026 is set to batch (hold) rendering until DECSET 2026 is reset to flush the queued screen data.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L356" href="#L356">356</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L357" href="#L357">357</a><span class="code-text"><a-p>#### </a-p><a-tt>Device Functions</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L358" href="#L358">358</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L359" href="#L359">359</a><span class="code-text"><a-p>#### </a-p><a-tt>Window Functions</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L360" href="#L360">360</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L361" href="#L361">361</a><span class="code-text"><a-p>### </a-p><a-tt>DCS - Device Control String</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L362" href="#L362">362</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L363" href="#L363">363</a><span class="code-text"><a-p>The `C1` `DCS` escape places the terminal parser into a device control mode until the `C1` `ST` is encountered.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L364" href="#L364">364</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L365" href="#L365">365</a><span class="code-text"><a-p>In the table below, `DCS` can be either the 7-bit representation (`ESC P`) or the 8-bit codepoint (`0x90`).</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L366" href="#L366">366</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L367" href="#L367">367</a><span class="code-text"><a-p>|Seq     | Name  | Description         |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L368" href="#L368">368</a><span class="code-text"><a-p>|--------|-------|---------------------|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L369" href="#L369">369</a><span class="code-text"><a-p>|DCS $ q &quot; p ST | [DECRQSS](https://vt100.net/docs/vt510-rm/DECRQSS.html) for [DECSCL](https://vt100.net/docs/vt510-rm/DECSCL.html) | Request Conformance Level; Reports the conformance level |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L370" href="#L370">370</a><span class="code-text"><a-p>|DCS $ q r ST   | [DECRQSS](https://vt100.net/docs/vt510-rm/DECRQSS.html) for [DECSTBM](https://vt100.net/docs/vt510-rm/DECSTBM.html) | Request top and bottom margin report; Reports the margins |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L371" href="#L371">371</a><span class="code-text"><a-p>|DCS $ q s ST   | [DECRQSS](https://vt100.net/docs/vt510-rm/DECRQSS.html) for [DECSLRM](https://vt100.net/docs/vt510-rm/DECSLRM.html) | Request left and right margin report; Reports the margins |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L372" href="#L372">372</a><span class="code-text"><a-p>|DCS \[PARAMS\] q \[DATA\] ST | Sixel Graphic Data | Decodes [Sixel graphic data](https://vt100.net/docs/vt3xx-gp/chapter14.html) and apply the image to the terminal model. Support is preliminary and incomplete; see [this issue](https://github.com/wezterm/wezterm/issues/217) for status. |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L373" href="#L373">373</a><span class="code-text"><a-p>|DCS 1000 q | tmux control mode | Bridges tmux into the WezTerm multiplexer.  Currently incomplete, see [this issue](https://github.com/wezterm/wezterm/issues/336) for status. |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L374" href="#L374">374</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L375" href="#L375">375</a><span class="code-text"><a-p>### </a-p><a-tt>Operating System Command Sequences</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L376" href="#L376">376</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L377" href="#L377">377</a><span class="code-text"><a-p>Operating System Command (OSC) sequences are introduced via `ESC ]` followed by</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L378" href="#L378">378</a><span class="code-text"><a-p>a numeric code and typically have parameters delimited by `;`.  OSC sequences</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L379" href="#L379">379</a><span class="code-text"><a-p>are canonically delimited by the `ST` (String Terminator) sequence, but WezTerm</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L380" href="#L380">380</a><span class="code-text"><a-p>also accepts delimiting them with the `BEL` control.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L381" href="#L381">381</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L382" href="#L382">382</a><span class="code-text"><a-p>The table below is keyed by the OSC code.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L383" href="#L383">383</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L384" href="#L384">384</a><span class="code-text"><a-p>|OSC|Description|Action|Example|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L385" href="#L385">385</a><span class="code-text"><a-p>|---|-----------|------|-------|</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L386" href="#L386">386</a><span class="code-text"><a-p>|0  |Set Icon Name and Window Title | Clears Icon Name, sets Window Title. | `\x1b]0;title\x1b\\` |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L387" href="#L387">387</a><span class="code-text"><a-p>|1  |Set Icon Name | Sets Icon Name, which is used as the Tab title when it is non-empty | `\x1b]1;tab-title\x1b\\` |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L388" href="#L388">388</a><span class="code-text"><a-p>|2  |Set Window Title | Set Window Title | `\x1b]2;window-title\x1b\\` |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L389" href="#L389">389</a><span class="code-text"><a-p>|3  |Set X11 Window Property | Ignored | |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L390" href="#L390">390</a><span class="code-text"><a-p>|4  |Change/Query Color Number | Set or query color palette entries 0-255. | query color number 1: `\x1b]4;1;?\x1b\\` &lt;br/&gt; Set color number 2: `\x1b]4;2;#cccccc\x1b\\` |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L391" href="#L391">391</a><span class="code-text"><a-p>|5  |Change/Query Special Color Number | Ignored | |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L392" href="#L392">392</a><span class="code-text"><a-p>|6  |iTerm2 Change Title Tab Color | Ignored | |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L393" href="#L393">393</a><span class="code-text"><a-p>|7  |Set Current Working Directory | [See Shell Integration](shell-integration.md#osc-7-escape-sequence-to-set-the-working-directory) ||</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L394" href="#L394">394</a><span class="code-text"><a-p>|8  |Set Hyperlink | [See Explicit Hyperlinks](hyperlinks.md#explicit-hyperlinks) | |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L395" href="#L395">395</a><span class="code-text"><a-p>|9  |iTerm2 Show System Notification | Show a &quot;toast&quot; notification | `printf &quot;\e]9;%s\e\\&quot; &quot;hello there&quot;` |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L396" href="#L396">396</a><span class="code-text"><a-p>|10 |Set Default Text Foreground Color| | `\x1b]10;#ff0000\x1b\\`.&lt;br/&gt; Also supports RGBA in nightly builds: `printf &quot;\e]10;rgba(127,127,127,0.4)\x07&quot;` |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L397" href="#L397">397</a><span class="code-text"><a-p>|11 |Set Default Text Background Color| | `\x1b]11;#0000ff\x1b\\`.&lt;br/&gt; Also supports RGBA in nightly builds: `printf &quot;\e]11;rgba:efff/ecff/f4ff/d000\x07&quot;` |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L398" href="#L398">398</a><span class="code-text"><a-p>|12 |Set Text Cursor Color| | `\x1b]12;#00ff00\x1b\\`.&lt;br/&gt; Also supports RGBA in nightly builds. |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L399" href="#L399">399</a><span class="code-text"><a-p>|52 |Manipulate clipboard | Requests to query the clipboard are ignored. Allows setting or clearing the clipboard | |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L400" href="#L400">400</a><span class="code-text"><a-p>|104|ResetColors | Reset color palette entries to their default values | |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L401" href="#L401">401</a><span class="code-text"><a-p>|133|FinalTerm semantic escapes| Informs the terminal about Input, Output and Prompt regions on the display | [See Shell Integration](shell-integration.md) |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L402" href="#L402">402</a><span class="code-text"><a-p>|777|Call rxvt extension| Only the notify extension is supported; it shows a &quot;toast&quot; notification | `printf &quot;\e]777;notify;%s;%s\e\\&quot; &quot;title&quot; &quot;body&quot;` |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L403" href="#L403">403</a><span class="code-text"><a-p>|1337 |iTerm2 File Upload Protocol | Allows displaying images inline | [See iTerm Image Protocol](imgcat.md) |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L404" href="#L404">404</a><span class="code-text"><a-p>|L  |Set Icon Name (Sun) | Same as OSC 1 | `\x1b]Ltab-title\x1b\\` |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L405" href="#L405">405</a><span class="code-text"><a-p>|l  |Set Window Title (Sun) | Same as OSC 2 | `\x1b]lwindow-title\x1b\\` |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L406" href="#L406">406</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L407" href="#L407">407</a><span class="code-text"><a-p># </a-p><a-tt>Additional Resources</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L408" href="#L408">408</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L409" href="#L409">409</a><span class="code-text"><a-p>* [xterm&#39;s escape sequences](http://invisible-island.net/xterm/ctlseqs/ctlseqs.txt)</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L410" href="#L410">410</a><span class="code-text"><a-p>* [iTerm2&#39;s escape sequences](https://iterm2.com/documentation-escape-codes.html)</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L411" href="#L411">411</a><span class="code-text"><a-p>* [kitty&#39;s escape sequences](https://sw.kovidgoyal.net/kitty/protocol-extensions.html)</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L412" href="#L412">412</a><span class="code-text"><a-p>* [Terminology&#39;s escape sequences](https://github.com/billiob/terminology#extended-escapes-for-terminology-only)</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L413" href="#L413">413</a><span class="code-text"><a-p>* [This Google spreadsheet](https://docs.google.com/spreadsheets/d/19W-lXWS9jYwqCK-LwgYo31GucPPxYVld_hVEcfpNpXg/edit?usp=sharing)</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L414" href="#L414">414</a><span class="code-text"><a-p>  aims to document all the known escape sequences.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L415" href="#L415">415</a><span class="code-text"><a-p>* </a-p>[Wikipedia&#39;s ANSI escape code page](https://en.wikipedia.org/wiki/ANSI_escape_code)</span></span></pre></div></div>
</main>
</body>
</html>
