1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555
|
<!DOCTYPE html>
<html lang="en" data-content_root="./">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Terminal Compatibility — fish-shell 4.2.1 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=4da8bbd6" />
<link rel="stylesheet" type="text/css" href="_static/pydoctheme.css?v=f89b4716" />
<script src="_static/documentation_options.js?v=6fb65176"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Contributing To Fish" href="contributing.html" />
<link rel="prev" title="Release notes" href="relnotes.html" />
<link rel="shortcut icon" type="image/png" href="_static/fish.png" />
</head><body><div id="fmain">
<div class="related" role="navigation" aria-label="Related">
<h3>Navigation</h3>
<ul>
<li><img src="_static/fish.png" alt=""
style="width: 80px; height: 80px; vertical-align: middle; margin-top: -1px"/></li>
<li><a href="https://fishshell.com/">fish-shell</a> »</li>
<a href="index.html">fish-shell 4.2.1 documentation</a> »
<li class="nav-item nav-item-this"><a href="">Terminal Compatibility</a></li>
<li class="right">
<div class="inline-search" role="search">
<form class="inline-search" action="search.html" method="get">
<input placeholder="Quick search" type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</li>
<div id="old-docs-notice" style="display: none">
This documents an old version of fish.
<a href="../current/">See the latest release.</a>
</div>
</ul>
</div>
<div class="document">
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<div>
<h3><a href="index.html">Documents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="index.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">Frequently asked questions</a></li>
<li class="toctree-l1"><a class="reference internal" href="interactive.html">Interactive use</a></li>
<li class="toctree-l1"><a class="reference internal" href="language.html">The fish language</a></li>
<li class="toctree-l1"><a class="reference internal" href="commands.html">Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="fish_for_bash_users.html">Fish for bash users</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html">Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="completions.html">Writing your own completions</a></li>
<li class="toctree-l1"><a class="reference internal" href="prompt.html">Writing your own prompt</a></li>
<li class="toctree-l1"><a class="reference internal" href="design.html">Design</a></li>
<li class="toctree-l1"><a class="reference internal" href="relnotes.html">Release notes</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Terminal Compatibility</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing To Fish</a></li>
<li class="toctree-l1"><a class="reference internal" href="license.html">License</a></li>
</ul>
</div>
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
<div>
<h4><a href="index.html">Sections</a></h4>
<ul>
<li><a class="reference internal" href="#">Terminal Compatibility</a><ul>
<li><a class="reference internal" href="#required-commands">Required Commands</a></li>
<li><a class="reference internal" href="#optional-commands">Optional Commands</a></li>
<li><a class="reference internal" href="#dcs-commands-and-gnu-screen">DCS commands and GNU screen</a></li>
<li><a class="reference internal" href="#unicode-codepoints">Unicode Codepoints</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="terminal-compatibility">
<h1>Terminal Compatibility<a class="headerlink" href="#terminal-compatibility" title="Link to this heading">¶</a></h1>
<p>fish writes various control sequences to the terminal.
Some must be implemented to enable basic functionality,
while others enable optional features and may be ignored by the terminal.</p>
<p>The terminal must be able to parse Control Sequence Introducer (CSI) commands, Operating System Commands (OSC) and <a class="reference internal" href="#term-compat-dcs-gnu-screen"><span class="std std-ref">optionally</span></a> Device Control Strings (DCS).
These are defined by ECMA-48.
If a valid CSI, OSC or DCS sequence does not represent a command implemented by the terminal, the terminal must ignore it.</p>
<p>Control sequences are denoted in a fish-like syntax.
Special characters other than <code class="docutils literal notranslate"><span class="pre">\</span></code> are not escaped.
Spaces are only added for readability and are not part of the sequence.
Placeholders are written as <code class="docutils literal notranslate"><span class="pre">Ps</span></code> for a number or <code class="docutils literal notranslate"><span class="pre">Pt</span></code> for an arbitrary printable string.</p>
<p><strong>NOTE:</strong> fish does not rely on your system’s terminfo database.
In this document, terminfo (TI) codes are included for reference only.</p>
<section id="required-commands">
<h2>Required Commands<a class="headerlink" href="#required-commands" title="Link to this heading">¶</a></h2>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>Sequence</p></th>
<th class="head"><p>TI</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\r</span></code></p></td>
<td><p>n/a</p></td>
<td><p>Move cursor to the beginning of the line</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\n</span></code></p></td>
<td><p>cud1</p></td>
<td><p>Move cursor down one line.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\e[ Ps A</span></code></p></td>
<td><p>cuu</p></td>
<td><p>Move cursor up Ps columns, or one column if no parameter.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\e[ Ps C</span></code></p></td>
<td><p>cuf</p></td>
<td><p>Move cursor to the right Ps columns, or one column if no parameter.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\x08</span></code></p></td>
<td><p>cub1</p></td>
<td><p>Move cursor one column to the left.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\e[ Ps D</span></code></p></td>
<td><p>cub</p></td>
<td><p>Move cursor to the left Ps times.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\e[H</span></code></p></td>
<td><p>cup</p></td>
<td><p>Set cursor position (no parameters means: move to row 1, column 1).</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\e[K</span></code></p></td>
<td><p>el</p></td>
<td><p>Clear to end of line.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\e[J</span></code></p></td>
<td><p>ed</p></td>
<td><p>Clear to the end of screen.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\e[2J</span></code></p></td>
<td><p>clear</p></td>
<td><p>Clear the screen.</p></td>
</tr>
<tr class="row-even"><td><p id="term-compat-primary-da"><code class="docutils literal notranslate"><span class="pre">\e[0c</span></code></p>
</td>
<td></td>
<td><p>Request Primary Device Attribute.
The terminal must respond with a CSI command that starts with the <code class="docutils literal notranslate"><span class="pre">?</span></code> parameter byte (so a sequence starting with <code class="docutils literal notranslate"><span class="pre">\e[?</span></code>) and has <code class="docutils literal notranslate"><span class="pre">c</span></code> as final byte.</p>
<p>Failure to implement this will cause a brief pause at startup followed by a warning.
For the time being, both can be turned off by turning off the <code class="docutils literal notranslate"><span class="pre">query-terminal</span></code> <a class="reference internal" href="language.html#featureflags"><span class="std std-ref">feature flag</span></a>.</p>
</td>
</tr>
<tr class="row-odd"><td><p>n/a</p></td>
<td><p>am</p></td>
<td><p>Soft wrap text at screen width.</p></td>
</tr>
<tr class="row-even"><td><p>n/a</p></td>
<td><p>xenl</p></td>
<td><p>Printing to the last column does not move the cursor to the next line.
Verify this by running <code class="docutils literal notranslate"><span class="pre">printf</span> <span class="pre">%0"$COLUMNS"d</span> <span class="pre">0;</span> <span class="pre">sleep</span> <span class="pre">3</span></code></p></td>
</tr>
</tbody>
</table>
</section>
<section id="optional-commands">
<h2>Optional Commands<a class="headerlink" href="#optional-commands" title="Link to this heading">¶</a></h2>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>Sequence</p></th>
<th class="head"><p>TI</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\t</span></code></p></td>
<td><p>it</p></td>
<td><p>Move the cursor to the next tab stop (à 8 columns).
This is mainly relevant if your prompt includes tabs.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\e[m</span></code></p></td>
<td><p>sgr0</p></td>
<td><p>Turn off bold/dim/italic/underline/reverse attribute modes and select default colors.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\e[1m</span></code></p></td>
<td><p>bold</p></td>
<td><p>Enter bold mode.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\e[2m</span></code></p></td>
<td><p>dim</p></td>
<td><p>Enter dim mode.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\e[3m</span></code></p></td>
<td><p>sitm</p></td>
<td><p>Enter italic mode.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\e[4m</span></code></p></td>
<td><p>smul</p></td>
<td><p>Enter underline mode.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\e[4:2m</span></code></p></td>
<td><p>Su</p></td>
<td><p>Enter double underline mode.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\e[4:3m</span></code></p></td>
<td><p>Su</p></td>
<td><p>Enter curly underline mode.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\e[4:4m</span></code></p></td>
<td><p>Su</p></td>
<td><p>Enter dotted underline mode.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\e[4:5m</span></code></p></td>
<td><p>Su</p></td>
<td><p>Enter dashed underline mode.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\e[7m</span></code></p></td>
<td><p>rev</p></td>
<td><p>Enter reverse video mode (swap foreground and background colors).</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\e[23m</span></code></p></td>
<td><p>ritm</p></td>
<td><p>Exit italic mode.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\e[24m</span></code></p></td>
<td><p>rmul</p></td>
<td><p>Exit underline mode.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\e[38;5;</span> <span class="pre">Ps</span> <span class="pre">m</span></code></p></td>
<td><p>setaf</p></td>
<td><p>Select foreground color Ps from the 256-color-palette.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\e[48;5;</span> <span class="pre">Ps</span> <span class="pre">m</span></code></p></td>
<td><p>setab</p></td>
<td><p>Select background color Ps from the 256-color-palette.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\e[58:5:</span> <span class="pre">Ps</span> <span class="pre">m</span></code> (note: colons not semicolons)</p></td>
<td><p>Su</p></td>
<td><p>Select underline color Ps from the 256-color-palette.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\e[</span> <span class="pre">Ps</span> <span class="pre">m</span></code></p></td>
<td><p>setaf
setab</p></td>
<td><p>Select foreground/background color. This uses a color in the aforementioned 256-color-palette, based on the range that contains the parameter:
30-37 maps to foreground 0-7,
40-47 maps to background 0-7,
90-97 maps to foreground 8-15 and
100-107 maps to background 8-15.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\e[38;2;</span> <span class="pre">Ps</span> <span class="pre">;</span> <span class="pre">Ps</span> <span class="pre">;</span> <span class="pre">Ps</span> <span class="pre">m</span></code></p></td>
<td></td>
<td><p>Select foreground color from 24-bit RGB colors.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\e[48;2;</span> <span class="pre">Ps</span> <span class="pre">;</span> <span class="pre">Ps</span> <span class="pre">;</span> <span class="pre">Ps</span> <span class="pre">m</span></code></p></td>
<td></td>
<td><p>Select background color from 24-bit RGB colors.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\e[49m</span></code></p></td>
<td></td>
<td><p>Reset background color to the terminal’s default.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\e[58:2::</span> <span class="pre">Ps</span> <span class="pre">:</span> <span class="pre">Ps</span> <span class="pre">:</span> <span class="pre">Ps</span> <span class="pre">m</span></code> (note: colons not semicolons)</p></td>
<td><p>Su</p></td>
<td><p>Select underline color from 24-bit RGB colors.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\e[59m</span></code></p></td>
<td><p>Su</p></td>
<td><p>Reset underline color to the default (follow the foreground color).</p></td>
</tr>
<tr class="row-even"><td><p id="term-compat-indn"><code class="docutils literal notranslate"><span class="pre">\e[</span> <span class="pre">Ps</span> <span class="pre">S</span></code></p>
</td>
<td><p>indn</p></td>
<td><p>Scroll up the content (not the viewport) Ps lines (called <code class="docutils literal notranslate"><span class="pre">SCROLL</span> <span class="pre">UP</span></code> / <code class="docutils literal notranslate"><span class="pre">SU</span></code> by ECMA-48 and “scroll forward” by terminfo).
When fish detects support for this feature, <a class="reference internal" href="cmds/status.html#status-test-terminal-features"><span class="std std-ref">status test-terminal-features scroll-content-up</span></a> will return 0,
which enables the <kbd class="kbd docutils literal notranslate">ctrl</kbd>-<kbd class="kbd docutils literal notranslate">l</kbd> binding to use the <a class="reference internal" href="cmds/bind.html#special-input-functions-scrollback-push"><span class="std std-ref">scrollback-push</span></a> special input function.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\e[=</span> <span class="pre">Ps</span> <span class="pre">u</span></code>, <code class="docutils literal notranslate"><span class="pre">\e[?</span> <span class="pre">Ps</span> <span class="pre">u</span></code></p></td>
<td><p>n/a</p></td>
<td><p>Enable the kitty keyboard protocol.</p></td>
</tr>
<tr class="row-even"><td><p id="term-compat-cursor-position-report"><code class="docutils literal notranslate"><span class="pre">\e[6n</span></code></p>
</td>
<td><p>n/a</p></td>
<td><p>Request cursor position report.
The response must be of the form <code class="docutils literal notranslate"><span class="pre">\e[</span> <span class="pre">Ps</span> <span class="pre">;</span> <span class="pre">Ps</span> <span class="pre">R</span></code>
where the first parameter is the row number
and the second parameter is the column number.
Both start at 1.</p>
<p>This is used for truncating multiline autosuggestions at the screen’s bottom edge,
by the <a class="reference internal" href="cmds/bind.html#special-input-functions-scrollback-push"><span class="std std-ref">scrollback-push</span></a> special input function,
and inside terminals that implement the OSC 133 <a class="reference internal" href="#term-compat-osc-133"><span class="std std-ref">click_events</span></a> feature.</p>
</td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\e[</span> <span class="pre">\x20</span> <span class="pre">q</span></code></p></td>
<td><p>Se</p></td>
<td><p>Reset cursor style to the terminal’s default. This is not used as of today but may be
in future.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\e[</span> <span class="pre">Ps</span> <span class="pre">\x20</span> <span class="pre">q</span></code></p></td>
<td><p>Ss</p></td>
<td><p>Set cursor style (DECSCUSR); Ps is 2, 4 or 6 for block, underscore or line shape.</p></td>
</tr>
<tr class="row-odd"><td><p id="term-compat-xtversion"><code class="docutils literal notranslate"><span class="pre">\e[</span> <span class="pre">Ps</span> <span class="pre">q</span></code></p>
</td>
<td><p>n/a</p></td>
<td><p>Request terminal name and version (XTVERSION).
This is only used for temporary workarounds for incompatible terminals.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\e[?25h</span></code></p></td>
<td><p>cvvis</p></td>
<td><p>Enable cursor visibility (DECTCEM).</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\e[?1004h</span></code></p></td>
<td><p>n/a</p></td>
<td><p>Enable focus reporting.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\e[?1004l</span></code></p></td>
<td><p>n/a</p></td>
<td><p>Disable focus reporting.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\e[?1049h</span></code></p></td>
<td><p>n/a</p></td>
<td><p>Enable alternate screen buffer.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\e[?1049l</span></code></p></td>
<td><p>n/a</p></td>
<td><p>Disable alternate screen buffer.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\e[?2004h</span></code></p></td>
<td></td>
<td><p>Enable bracketed paste.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\e[?2004l</span></code></p></td>
<td></td>
<td><p>Disable bracketed paste.</p></td>
</tr>
<tr class="row-odd"><td><p id="term-compat-osc-0"><code class="docutils literal notranslate"><span class="pre">\e]0;</span> <span class="pre">Pt</span> <span class="pre">\x07</span></code></p>
</td>
<td><p>ts</p></td>
<td><p>Set terminal window title (OSC 0). Used in <a class="reference internal" href="cmds/fish_title.html"><span class="doc">fish_title</span></a>.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\e]2;</span> <span class="pre">Pt</span> <span class="pre">\x07</span></code></p></td>
<td><p>ts</p></td>
<td><p>Set terminal tab title (OSC 1). Used in <a class="reference internal" href="cmds/fish_tab_title.html"><span class="doc">fish_tab_title</span></a>.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\e]7;file://</span> <span class="pre">Pt</span> <span class="pre">/</span> <span class="pre">Pt</span> <span class="pre">\x07</span></code></p></td>
<td></td>
<td><p>Report working directory (OSC 7).
Since the terminal may be running on a different system than a (remote) shell,
the hostname (first parameter) will <em>not</em> be <code class="docutils literal notranslate"><span class="pre">localhost</span></code>.</p></td>
</tr>
<tr class="row-even"><td><p id="term-compat-osc-8"><code class="docutils literal notranslate"><span class="pre">\e]8;;</span> <span class="pre">Pt</span> <span class="pre">\e\\</span></code></p>
</td>
<td></td>
<td><p>Create a <a class="reference external" href="https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda">hyperlink (OSC 8)</a>.
This is used in fish’s man pages.</p></td>
</tr>
<tr class="row-odd"><td><p id="term-compat-osc-52"><code class="docutils literal notranslate"><span class="pre">\e]52;c;</span> <span class="pre">Pt</span> <span class="pre">\x07</span></code></p>
</td>
<td></td>
<td><p>Copy to clipboard (OSC 52). Used by <a class="reference internal" href="cmds/fish_clipboard_copy.html"><span class="doc">fish_clipboard_copy</span></a>.</p></td>
</tr>
<tr class="row-even"><td><p id="term-compat-osc-133"><code class="docutils literal notranslate"><span class="pre">\e]133;A;</span> <span class="pre">click_events=1\x07</span></code></p>
</td>
<td></td>
<td><p>Mark prompt start (OSC 133), with kitty’s <code class="docutils literal notranslate"><span class="pre">click_events</span></code> extension.
The <code class="docutils literal notranslate"><span class="pre">click_events</span></code> extension enables mouse clicks to move the cursor or select pager items,
assuming that <a class="reference internal" href="#term-compat-cursor-position-report"><span class="std std-ref">cursor position reporting</span></a> is available.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">\e]133;C;</span> <span class="pre">cmdline_url=</span> <span class="pre">Pt</span> <span class="pre">\x07</span></code></p></td>
<td></td>
<td><p>Mark command start (OSC 133), with kitty’s <code class="docutils literal notranslate"><span class="pre">cmdline_url</span></code> extension whose parameter is the URL-encoded command line.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">\e]133;D;</span> <span class="pre">Ps</span> <span class="pre">\x07</span></code></p></td>
<td></td>
<td><p>Mark command end (OSC 133); Ps is the exit status.</p></td>
</tr>
<tr class="row-odd"><td><blockquote id="term-compat-xtgettcap">
<div><p><code class="docutils literal notranslate"><span class="pre">\eP+q</span> <span class="pre">Pt</span> <span class="pre">\e\\</span></code></p>
</div></blockquote>
</td>
<td></td>
<td><p>Request terminfo capability (XTGETTCAP).
The parameter is the capability’s hex-encoded terminfo code.
To advertise a capability, the response must be of the form
<code class="docutils literal notranslate"><span class="pre">\eP1+q</span> <span class="pre">Pt</span> <span class="pre">\e\\</span></code> or <code class="docutils literal notranslate"><span class="pre">\eP1+q</span> <span class="pre">Pt</span> <span class="pre">=</span> <span class="pre">Pt</span> <span class="pre">\e\\</span></code>.
In either variant the first parameter must be the hex-encoded terminfo code.
The second variant’s second parameter is ignored.</p>
<p>Currently, fish only queries the <a class="reference internal" href="#term-compat-indn"><span class="std std-ref">indn</span></a> string capability.</p>
</td>
</tr>
</tbody>
</table>
</section>
<section id="dcs-commands-and-gnu-screen">
<span id="term-compat-dcs-gnu-screen"></span><h2>DCS commands and GNU screen<a class="headerlink" href="#dcs-commands-and-gnu-screen" title="Link to this heading">¶</a></h2>
<p>Fully-correct DCS parsing is optional because fish switches to the alternate screen before printing any DCS commands.
However, since GNU screen neither allows turning on the alternate screen buffer by default,
nor treats DCS commands in a compatible way,
fish’s initial prompt may be garbled by a DCS payload like <code class="docutils literal notranslate"><span class="pre">+q696e646e</span></code>.
For the time being, fish works around this by checking for presence of the <span class="target" id="index-0"></span><code class="xref std std-envvar docutils literal notranslate"><span class="pre">STY</span></code> environment variable.
If that doesn’t work for some reason, you can add this to your <code class="docutils literal notranslate"><span class="pre">~/.screenrc</span></code>:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>altscreen on
</pre></div>
</div>
<p>Or add this to your <code class="docutils literal notranslate"><span class="pre">config.fish</span></code>:</p>
<div class="highlight-fish-docs-samples notranslate"><div class="highlight"><pre><span></span><span class="nf">function</span><span class="w"> </span><span class="no">GNU-screen-workaround</span><span class="w"> </span><span class="no">--on-event</span><span class="w"> </span><span class="no">fish_prompt</span>
<span class="w"> </span><span class="nf">commandline</span><span class="w"> </span><span class="no">-f</span><span class="w"> </span><span class="no">repaint</span>
<span class="w"> </span><span class="nf">functions</span><span class="w"> </span><span class="no">--erase</span><span class="w"> </span><span class="no">GNU-screen-workaround</span>
<span class="nf">end</span>
</pre></div>
</div>
</section>
<section id="unicode-codepoints">
<span id="term-compat-unicode-codepoints"></span><h2>Unicode Codepoints<a class="headerlink" href="#unicode-codepoints" title="Link to this heading">¶</a></h2>
<p>By default, fish outputs the following non-ASCII characters:</p>
<div class="highlight-fish-docs-samples notranslate"><div class="highlight"><pre><span></span><span class="nf">×</span><span class="w"> </span><span class="no">►</span><span class="w"> </span><span class="no">¶</span><span class="w"> </span><span class="no">⏎</span><span class="w"> </span><span class="no">•</span><span class="w"> </span><span class="no">●</span><span class="w"> </span><span class="no">…</span><span class="w"> </span><span class="no">μ</span><span class="w"> </span><span class="no">–</span><span class="w"> </span><span class="no">’</span><span class="w"> </span><span class="no">‘</span><span class="w"> </span><span class="no">“</span><span class="w"> </span><span class="no">”</span><span class="w"> </span><span class="no">←</span><span class="w"> </span><span class="no">→</span><span class="w"> </span><span class="no">↑</span><span class="w"> </span><span class="no">↓</span>
</pre></div>
</div>
<p>as well as control pictures (U+2400 through U+241F),
and locale-specific ones in <a class="reference internal" href="language.html#variables-locale"><span class="std std-ref">translated strings</span></a>.</p>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="Related">
<h3>Navigation</h3>
<ul>
<li><img src="_static/fish.png" alt=""
style="width: 80px; height: 80px; vertical-align: middle; margin-top: -1px"/></li>
<li><a href="https://fishshell.com/">fish-shell</a> »</li>
<a href="index.html">fish-shell 4.2.1 documentation</a> »
<li class="nav-item nav-item-this"><a href="">Terminal Compatibility</a></li>
<li class="right">
<div class="inline-search" role="search">
<form class="inline-search" action="search.html" method="get">
<input placeholder="Quick search" type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</li>
<div id="old-docs-notice" style="display: none">
This documents an old version of fish.
<a href="../current/">See the latest release.</a>
</div>
</ul>
</div>
<div class="footer">
© Copyright fish-shell developers.
<br />
<a href="https://github.com/fish-shell/fish-shell/issues">Found a bug</a>?
<br />
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.2.3.
</div>
</div>
<script type="text/javascript">
FISH_DOCS_VERSION = "4.2";
function copy_to_clipboard(it) {
// Find the pre tag we're interested in.
var pre = it.target;
while (pre.tagName != "PRE") pre = pre.parentNode;
var txt = "";
// Cheesy: If we have a prompt,
// we only copy prompted lines,
// by splitting and matching and stuff
if (pre.querySelector('span.gp')) {
var texts= [];
for (var line of pre.innerText.split('\n')) {
if (line.match(/^>_?.*/)) {
texts.push(line.replace(/^>_?/, ""));
}
}
txt = texts.join("\n");
} else {
// Even cheesier: If we don't have a prompt, we remove the button text from the end.
var txt = pre.innerText.substring(0, pre.innerText.length - it.target.innerText.length).trim();
}
navigator.clipboard.writeText(txt).then(function() {
// Success - set the text to indicate it,
// then set it back after 2 seconds.
var span = pre.querySelector("button span");
if (span) {
var oldText = span.innerText;
span.innerText = "COPIED!";
setTimeout(function() {
span.innerText = oldText;
}, 2000);
}
}, function() {
});
}
(function () {
// Add copy buttons to all the codeblocks.
var codeblocks = document.querySelectorAll('div > pre');
var button = document.createElement('button');
var span = document.createElement('span');
span.innerText = "COPY";
button.appendChild(span);
for (var i of codeblocks) {
var newButton = button.cloneNode(true);
newButton.addEventListener('click', copy_to_clipboard);
i.appendChild(newButton);
}
})();
</script>
</body>
</html>
|