diff options
Diffstat (limited to 'posts/escape-sequence/index.html')
-rw-r--r-- | posts/escape-sequence/index.html | 1452 |
1 files changed, 1452 insertions, 0 deletions
diff --git a/posts/escape-sequence/index.html b/posts/escape-sequence/index.html new file mode 100644 index 0000000..1a19b68 --- /dev/null +++ b/posts/escape-sequence/index.html @@ -0,0 +1,1452 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8" /> + <meta name="generator" content="Hugo 0.110.0"> + + <meta http-equiv="X-UA-Compatible" content="IE=edge" /> + <meta name="viewport" content="width=device-width, initial-scale=1" /> + <meta name="author" content="garhve" /> + <meta property="og:url" content="https://blog.garhve.com/posts/escape-sequence/" /> + <link rel="canonical" href="https://blog.garhve.com/posts/escape-sequence/" /><link rel="apple-touch-icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> + <link rel="icon" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> + <link rel="shortcut" href="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /><link rel="alternate" type="application/atom+xml" href="https://blog.garhve.comindex.xml" title="blog | garhve's hub"> + + <script type="application/ld+json"> + { + "@context" : "http://schema.org", + "@type" : "BlogPosting", + "mainEntityOfPage": { + "@type": "WebPage", + "@id": "https:\/\/blog.garhve.com" + }, + "articleSection" : "posts", + "name" : "Escape Sequences", + "headline" : "Escape Sequences", + "description" : "copied from github in case one day it disappears\nmore information could visit vt100 User Guide\nANSI Escape Sequences Standard escape codes are prefixed with Escape:\nCtrl-Key: ^[ Octal: \\033 Unicode: \\u001b Hexadecimal: \\x1B Decimal: 27 Followed by the command, somtimes delimited by opening square bracket ([), known as a Control Sequence Introducer (CSI), optionally followed by arguments and the command itself.\nArguments are delimeted by semi colon (;).", + "inLanguage" : "en-US", + "author" : "garhve", + "creator" : "garhve", + "publisher": "garhve", + "accountablePerson" : "garhve", + "copyrightHolder" : "garhve", + "copyrightYear" : "2022", + "datePublished": "2022-09-12 09:02:06 \u002b0800 CST", + "dateModified" : "2022-09-12 09:02:06 \u002b0800 CST", + "url" : "https:\/\/blog.garhve.com\/posts\/escape-sequence\/", + "keywords" : [ ] + } +</script> +<title>Escape Sequences</title> + <meta property="og:title" content="Escape Sequences" /> + <meta property="og:type" content="article" /> + <meta property="og:description" content="copied from github in case one day it disappears +more information could visit vt100 User Guide +ANSI Escape Sequences Standard escape codes are prefixed with Escape: +Ctrl-Key: ^[ Octal: \033 Unicode: \u001b Hexadecimal: \x1B Decimal: 27 Followed by the command, somtimes delimited by opening square bracket ([), known as a Control Sequence Introducer (CSI), optionally followed by arguments and the command itself. +Arguments are delimeted by semi colon (;)." /> + <meta name="description" content="copied from github in case one day it disappears +more information could visit vt100 User Guide +ANSI Escape Sequences Standard escape codes are prefixed with Escape: +Ctrl-Key: ^[ Octal: \033 Unicode: \u001b Hexadecimal: \x1B Decimal: 27 Followed by the command, somtimes delimited by opening square bracket ([), known as a Control Sequence Introducer (CSI), optionally followed by arguments and the command itself. +Arguments are delimeted by semi colon (;)." /> + <meta property="og:locale" content="en-us" /><meta property="og:image" content="https://assets.garhve.com/pictures/assets/images/favicon/favicon.ico" /> + + + + + <style>@font-face{font-family:huanzi;src:url(/fonts/huanzi.woff2)format('woff2')}@font-face{font-family:fira code;src:url(/fonts/FiraCode-Regular.woff2)format('woff2')}body{font-family:bree serif,huanzi,sans-serif;-webkit-font-smoothing:antialiased;margin:0 20px}article{max-width:800px;margin-left:auto;margin-right:auto}a{color:#000;text-decoration:none}a:hover{font-weight:600;text-decoration:underline}.post-ads{margin:50px 0}.markdown-body{font-size:18px;max-width:100%}.markdown-body a{text-decoration:underline;text-decoration-color:#000}.markdown-body blockquote{margin:0;padding:0 1em;color:#57606a;border-left:.25em solid #d0d7de}.markdown-body pre{padding:16px;overflow:auto;border-radius:10px}.markdown-body code{padding:.2em .4em;font-size:80%;background-color:inherit;border-radius:6px;font-family:fira code,monospace}code{text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%}table{width:100%}.markdown-body pre>code{padding:0;font-size:70%;background-color:inherit;border:0;font-family:fira code,monospace}.Chinese .markdown-body{line-height:200%}.site-date-catalog{font-size:2rem}.header-title{font-size:2rem;font-weight:700;margin-top:32px;font-family:bungee shade,sans-serif}.header-title a{text-decoration:none}.header-subtitle{color:#666}.header-items{margin:10px 0}.header-item{margin:0 5px}.header-line{width:100%;border-width:2px;border-color:#482936;border-style:solid none none none}.lang-switch{font-weight:600}#posts-list{min-height:600px}.posts-line{font-size:1.2rem;margin:12px 0}.posts-categories{font-size:.8rem;margin:auto;text-align:center}.posts-category{padding:3px 0;border:#000 2px solid;border-radius:5px}.site-footer{margin-top:50px}.site-footer-item{margin-right:12px}.post-content img{max-width:100%;display:block;margin-right:auto;margin-top:12px}.post-header{margin-bottom:50px}.post-title{font-size:2rem;font-weight:600}.post-tags{display:inline;font-weight:600;padding:2px 5px;margin-right:6px;border:#000 2px solid;border-radius:5px}.post-date{font-weight:800;font-style:italic}.post-author{float:right;font-weight:600}.page-content{min-height:60%}.post-content{margin-bottom:50px}.post-content p{hyphens:auto;line-height:1.8;text-justify:ideographic;margin-bottom:1em}.related-content{border-width:3px;border-style:solid;border-color:#000;padding:0 10px;margin-bottom:50px;margin-top:100px}.related-content li{margin:5px 0}.taxonomy-term{font-size:3rem}.gallery-img{text-align:center}.gallery-img span{text-align:center}.gallery-img-desc{font-size:.8em;font-weight:800}#disqus_thread{position:relative}#disqus_thread:after{content:"";display:block;height:55px;width:100%;position:absolute;bottom:0;background:#fff}@media screen and (max-width:600px){.header-title,.header-subtitle,.header-items{text-align:center}.posts-line{font-size:16px}.markdown-body{font-size:16px}.post-title{font-size:2rem}.post-content p{letter-spacing:.05em}}@media screen and (max-width:48em){.posts-category{display:none}}</style> + + + <style>.container,.container-fluid{margin-right:auto;margin-left:auto}.container-fluid{padding-right:2rem;padding-left:2rem}.row{box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:initial;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-.5rem;margin-left:-.5rem}.row.reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.col.reverse{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse}.col-xs,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-offset-0,.col-xs-offset-1,.col-xs-offset-10,.col-xs-offset-11,.col-xs-offset-12,.col-xs-offset-2,.col-xs-offset-3,.col-xs-offset-4,.col-xs-offset-5,.col-xs-offset-6,.col-xs-offset-7,.col-xs-offset-8,.col-xs-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-xs{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-xs-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-xs-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-xs-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-xs-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-xs-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-xs-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-xs-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-xs-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-xs-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-xs-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-xs-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-xs-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-11{margin-left:91.66666667%}.start-xs{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-xs{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-xs{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-xs{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-xs{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-xs{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-xs{-ms-flex-pack:distribute;justify-content:space-around}.between-xs{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-xs{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-xs{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}@media only screen and (min-width:48em){.container{width:49rem}.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-offset-0,.col-sm-offset-1,.col-sm-offset-10,.col-sm-offset-11,.col-sm-offset-12,.col-sm-offset-2,.col-sm-offset-3,.col-sm-offset-4,.col-sm-offset-5,.col-sm-offset-6,.col-sm-offset-7,.col-sm-offset-8,.col-sm-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-sm{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-sm-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-sm-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-sm-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-sm-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-sm-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-sm-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-sm-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-sm-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-sm-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-sm-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-sm-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-sm-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-11{margin-left:91.66666667%}.start-sm{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-sm{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-sm{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-sm{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-sm{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-sm{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-sm{-ms-flex-pack:distribute;justify-content:space-around}.between-sm{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-sm{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-sm{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:64em){.container{width:65rem}.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-offset-0,.col-md-offset-1,.col-md-offset-10,.col-md-offset-11,.col-md-offset-12,.col-md-offset-2,.col-md-offset-3,.col-md-offset-4,.col-md-offset-5,.col-md-offset-6,.col-md-offset-7,.col-md-offset-8,.col-md-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-md{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-md-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-md-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-md-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-md-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-md-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-md-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-md-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-md-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-md-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-md-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-md-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-md-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-11{margin-left:91.66666667%}.start-md{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-md{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-md{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-md{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-md{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-md{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-md{-ms-flex-pack:distribute;justify-content:space-around}.between-md{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-md{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-md{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}@media only screen and (min-width:75em){.container{width:76rem}.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-offset-0,.col-lg-offset-1,.col-lg-offset-10,.col-lg-offset-11,.col-lg-offset-12,.col-lg-offset-2,.col-lg-offset-3,.col-lg-offset-4,.col-lg-offset-5,.col-lg-offset-6,.col-lg-offset-7,.col-lg-offset-8,.col-lg-offset-9{box-sizing:border-box;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:none;padding-right:.5rem;padding-left:.5rem}.col-lg{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:0;flex-basis:0;max-width:100%}.col-lg-1{-ms-flex-preferred-size:8.33333333%;flex-basis:8.33333333%;max-width:8.33333333%}.col-lg-2{-ms-flex-preferred-size:16.66666667%;flex-basis:16.66666667%;max-width:16.66666667%}.col-lg-3{-ms-flex-preferred-size:25%;flex-basis:25%;max-width:25%}.col-lg-4{-ms-flex-preferred-size:33.33333333%;flex-basis:33.33333333%;max-width:33.33333333%}.col-lg-5{-ms-flex-preferred-size:41.66666667%;flex-basis:41.66666667%;max-width:41.66666667%}.col-lg-6{-ms-flex-preferred-size:50%;flex-basis:50%;max-width:50%}.col-lg-7{-ms-flex-preferred-size:58.33333333%;flex-basis:58.33333333%;max-width:58.33333333%}.col-lg-8{-ms-flex-preferred-size:66.66666667%;flex-basis:66.66666667%;max-width:66.66666667%}.col-lg-9{-ms-flex-preferred-size:75%;flex-basis:75%;max-width:75%}.col-lg-10{-ms-flex-preferred-size:83.33333333%;flex-basis:83.33333333%;max-width:83.33333333%}.col-lg-11{-ms-flex-preferred-size:91.66666667%;flex-basis:91.66666667%;max-width:91.66666667%}.col-lg-12{-ms-flex-preferred-size:100%;flex-basis:100%;max-width:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-11{margin-left:91.66666667%}.start-lg{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:start}.center-lg{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.end-lg{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:end}.top-lg{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.middle-lg{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.bottom-lg{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.around-lg{-ms-flex-pack:distribute;justify-content:space-around}.between-lg{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.first-lg{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.last-lg{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}}</style> + + + + + <link href="/index.xml" rel="alternate" type="application/rss+xml" + title="blog | garhve's hub"> + + <link rel="preconnect" href="https://fonts.gstatic.com"> + <link href="https://fonts.googleapis.com/css?family=Bree+Serif|Bungee+Shade" rel="stylesheet"> + + + +</head> + + +<body> + <article class="post English" id="article"> + <div class="row"> + <div class="col-xs-12"> + <div class="site-header"> + +<header> + <div class="header-title"> + <a href="/" + >Garhve</a + > + </div> + <div class="header-subtitle"></div> +</header> +<div class="row end-md center-xs header-items"> +</div> +<div class="row end-xs"> + + <div class="lang-switch col-xs-3 col-xs-offset-9"> + <a href="/cn/">Chinese</a> + </div> + +</div> +<div class="header-line"></div> + + </div> + <header class="post-header"> + <h1 class="post-title">Escape Sequences</h1> + + <div class="row post-desc"> + <div class="col-xs-6"> + + <time class="post-date" datetime="2022-09-12 09:02:06 CST"> + 12 Sep 2022 + </time> + + </div> + <div class="col-xs-6"> + + <div class="post-author"> + <a target="_blank" href="https://garhve.com">@garhve</a> + </div> + + </div> + </div> + + </header> + + <div class="post-content markdown-body"> + + <blockquote> +<p>copied from <a href="https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797">github</a> in case one day it disappears</p> +<p>more information could visit <a href="https://vt100.net/docs/vt100-ug/chapter3.html">vt100 User Guide</a></p> +</blockquote> +<h1 id="ansi-escape-sequences">ANSI Escape Sequences</h1> +<p>Standard escape codes are prefixed with <code>Escape</code>:</p> +<ul> +<li>Ctrl-Key: <code>^[</code></li> +<li>Octal: <code>\033</code></li> +<li>Unicode: <code>\u001b</code></li> +<li>Hexadecimal: <code>\x1B</code></li> +<li>Decimal: <code>27</code></li> +</ul> +<p>Followed by the command, somtimes delimited by opening square bracket (<code>[</code>), known as a Control Sequence Introducer (CSI), optionally followed by arguments and the command itself.</p> +<p>Arguments are delimeted by semi colon (<code>;</code>).</p> +<p>For example:</p> +<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span><span style="font-weight:bold;font-style:italic">\x</span>1b[1;31m <span style="font-style:italic"># Set style to bold, red foreground.</span> +</span></span></code></pre></div><h2 id="sequences">Sequences</h2> +<ul> +<li><code>ESC</code> - sequence starting with <code>ESC</code> (<code>\x1B</code>)</li> +<li><code>CSI</code> - Control Sequence Introducer: sequence starting with <code>ESC [</code> or CSI (<code>\x9B</code>)</li> +<li><code>DCS</code> - Device Control String: sequence starting with <code>ESC P</code> or DCS (<code>\x90</code>)</li> +<li><code>OSC</code> - Operating System Command: sequence starting with <code>ESC ]</code> or OSC (<code>\x9D</code>)</li> +</ul> +<p>Any whitespaces between sequences and arguments should be ignored. They are present for improved readability.</p> +<h2 id="general-ascii-codes">General ASCII Codes</h2> +<table> +<thead> +<tr> +<th>Name</th> +<th>decimal</th> +<th>octal</th> +<th>hex</th> +<th>C-escape</th> +<th>Ctrl-Key</th> +<th>Description</th> +</tr> +</thead> +<tbody> +<tr> +<td><code>BEL</code></td> +<td>7</td> +<td>007</td> +<td>0x07</td> +<td><code>\a</code></td> +<td><code>^G</code></td> +<td>Terminal bell</td> +</tr> +<tr> +<td><code>BS</code></td> +<td>8</td> +<td>010</td> +<td>0x08</td> +<td><code>\b</code></td> +<td><code>^H</code></td> +<td>Backspace</td> +</tr> +<tr> +<td><code>HT</code></td> +<td>9</td> +<td>011</td> +<td>0x09</td> +<td><code>\t</code></td> +<td><code>^I</code></td> +<td>Horizontal TAB</td> +</tr> +<tr> +<td><code>LF</code></td> +<td>10</td> +<td>012</td> +<td>0x0A</td> +<td><code>\n</code></td> +<td><code>^J</code></td> +<td>Linefeed (newline)</td> +</tr> +<tr> +<td><code>VT</code></td> +<td>11</td> +<td>013</td> +<td>0x0B</td> +<td><code>\v</code></td> +<td><code>^K</code></td> +<td>Vertical TAB</td> +</tr> +<tr> +<td><code>FF</code></td> +<td>12</td> +<td>014</td> +<td>0x0C</td> +<td><code>\f</code></td> +<td><code>^L</code></td> +<td>Formfeed (also: New page<code>NP</code>)</td> +</tr> +<tr> +<td><code>CR</code></td> +<td>13</td> +<td>015</td> +<td>0x0D</td> +<td><code>\r</code></td> +<td><code>^M</code></td> +<td>Carriage return</td> +</tr> +<tr> +<td><code>ESC</code></td> +<td>27</td> +<td>033</td> +<td>0x1B</td> +<td><code>\e</code><a href="#escape">*</a></td> +<td><code>^[</code></td> +<td>Escape character</td> +</tr> +<tr> +<td><code>DEL</code></td> +<td>127</td> +<td>177</td> +<td>0x7F</td> +<td><code><none></code></td> +<td><code><none></code></td> +<td>Delete character</td> +</tr> +</tbody> +</table> +<div id="escape"></div> +<blockquote> +<p><strong>Note:</strong> Some control escape sequences, like <code>\e</code> for <code>ESC</code>, are not guaranteed to work in all languages and compilers. It is recommended to use the decimal, octal or hex representation as escape code.</p> +</blockquote> +<blockquote> +<p><strong>Note:</strong> The <strong>Ctrl-Key</strong> representation is simply associating the non-printable characters from ASCII code 1 with the printable (letter) characters from ASCII code 65 (“A”). ASCII code 1 would be <code>^A</code> (Ctrl-A), while ASCII code 7 (BEL) would be <code>^G</code> (Ctrl-G). This is a common representation (and input method) and historically comes from one of the VT series of terminals.</p> +</blockquote> +<h2 id="cursor-controls">Cursor Controls</h2> +<table> +<thead> +<tr> +<th style="text-align:left">ESC Code Sequence</th> +<th style="text-align:left">Description</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align:left"><code>ESC[H</code></td> +<td style="text-align:left">moves cursor to home position (0, 0)</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[{line};{column}H</code> <br> <code>ESC[{line};{column}f</code></td> +<td style="text-align:left">moves cursor to line #, column #</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[#A</code></td> +<td style="text-align:left">moves cursor up # lines</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[#B</code></td> +<td style="text-align:left">moves cursor down # lines</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[#C</code></td> +<td style="text-align:left">moves cursor right # columns</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[#D</code></td> +<td style="text-align:left">moves cursor left # columns</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[#E</code></td> +<td style="text-align:left">moves cursor to beginning of next line, # lines down</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[#F</code></td> +<td style="text-align:left">moves cursor to beginning of previous line, # lines up</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[#G</code></td> +<td style="text-align:left">moves cursor to column #</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[6n</code></td> +<td style="text-align:left">request cursor position (reports as<code>ESC[#;#R</code>)</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC M</code></td> +<td style="text-align:left">moves cursor one line up, scrolling if needed</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC 7</code></td> +<td style="text-align:left">save cursor position (DEC)</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC 8</code></td> +<td style="text-align:left">restores the cursor to the last saved position (DEC)</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[s</code></td> +<td style="text-align:left">save cursor position (SCO)</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[u</code></td> +<td style="text-align:left">restores the cursor to the last saved position (SCO)</td> +</tr> +</tbody> +</table> +<blockquote> +<p><strong>Note:</strong> Some sequences, like saving and restoring cursors, are private sequences and are not standardized. While some terminal emulators (i.e. xterm and derived) support both SCO and DEC sequences, they are likely to have different functionality. It is therefore recommended to use DEC sequences.</p> +</blockquote> +<h2 id="erase-functions">Erase Functions</h2> +<table> +<thead> +<tr> +<th style="text-align:left">ESC Code Sequence</th> +<th style="text-align:left">Description</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align:left"><code>ESC[J</code></td> +<td style="text-align:left">erase in display (same as ESC[0J)</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[0J</code></td> +<td style="text-align:left">erase from cursor until end of screen</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[1J</code></td> +<td style="text-align:left">erase from cursor to beginning of screen</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[2J</code></td> +<td style="text-align:left">erase entire screen</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[3J</code></td> +<td style="text-align:left">erase saved lines</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[K</code></td> +<td style="text-align:left">erase in line (same as ESC[0K)</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[0K</code></td> +<td style="text-align:left">erase from cursor to end of line</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[1K</code></td> +<td style="text-align:left">erase start of line to the cursor</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[2K</code></td> +<td style="text-align:left">erase the entire line</td> +</tr> +</tbody> +</table> +<blockquote> +<p>Note: Erasing the line won’t move the cursor, meaning that the cursor will stay at the last position it was at before the line was erased. You can use <code>\r</code> after erasing the line, to return the cursor to the start of the current line.</p> +</blockquote> +<h2 id="colors--graphics-mode">Colors / Graphics Mode</h2> +<table> +<thead> +<tr> +<th style="text-align:left">ESC Code Sequence</th> +<th style="text-align:left">Reset Sequence</th> +<th style="text-align:left">Description</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align:left"><code>ESC[1;34;{...}m</code></td> +<td style="text-align:left"></td> +<td style="text-align:left">Set graphics modes for cell, separated by semicolon (<code>;</code>).</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[0m</code></td> +<td style="text-align:left"></td> +<td style="text-align:left">reset all modes (styles and colors)</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[1m</code></td> +<td style="text-align:left"><code>ESC[22m</code></td> +<td style="text-align:left">set bold mode.</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[2m</code></td> +<td style="text-align:left"><code>ESC[22m</code></td> +<td style="text-align:left">set dim/faint mode.</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[3m</code></td> +<td style="text-align:left"><code>ESC[23m</code></td> +<td style="text-align:left">set italic mode.</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[4m</code></td> +<td style="text-align:left"><code>ESC[24m</code></td> +<td style="text-align:left">set underline mode.</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[5m</code></td> +<td style="text-align:left"><code>ESC[25m</code></td> +<td style="text-align:left">set blinking mode</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[7m</code></td> +<td style="text-align:left"><code>ESC[27m</code></td> +<td style="text-align:left">set inverse/reverse mode</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[8m</code></td> +<td style="text-align:left"><code>ESC[28m</code></td> +<td style="text-align:left">set hidden/invisible mode</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[9m</code></td> +<td style="text-align:left"><code>ESC[29m</code></td> +<td style="text-align:left">set strikethrough mode.</td> +</tr> +</tbody> +</table> +<blockquote> +<p><strong>Note:</strong> Some terminals may not support some of the graphic mode sequences listed above.</p> +</blockquote> +<blockquote> +<p><strong>Note:</strong> Both dim and bold modes are reset with the <code>ESC[22m</code> sequence. The <code>ESC[21m</code> sequence is a non-specified sequence for double underline mode and only work in some terminals and is reset with <code>ESC[24m</code>.</p> +</blockquote> +<h3 id="color-codes">Color codes</h3> +<p>Most terminals support 8 and 16 colors, as well as 256 (8-bit) colors. These colors are set by the user, but have commonly defined meanings.</p> +<h4 id="8-16-colors">8-16 Colors</h4> +<table> +<thead> +<tr> +<th style="text-align:left">Color Name</th> +<th style="text-align:left">Foreground Color Code</th> +<th style="text-align:left">Background Color Code</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align:left">Black</td> +<td style="text-align:left"><code>30</code></td> +<td style="text-align:left"><code>40</code></td> +</tr> +<tr> +<td style="text-align:left">Red</td> +<td style="text-align:left"><code>31</code></td> +<td style="text-align:left"><code>41</code></td> +</tr> +<tr> +<td style="text-align:left">Green</td> +<td style="text-align:left"><code>32</code></td> +<td style="text-align:left"><code>42</code></td> +</tr> +<tr> +<td style="text-align:left">Yellow</td> +<td style="text-align:left"><code>33</code></td> +<td style="text-align:left"><code>43</code></td> +</tr> +<tr> +<td style="text-align:left">Blue</td> +<td style="text-align:left"><code>34</code></td> +<td style="text-align:left"><code>44</code></td> +</tr> +<tr> +<td style="text-align:left">Magenta</td> +<td style="text-align:left"><code>35</code></td> +<td style="text-align:left"><code>45</code></td> +</tr> +<tr> +<td style="text-align:left">Cyan</td> +<td style="text-align:left"><code>36</code></td> +<td style="text-align:left"><code>46</code></td> +</tr> +<tr> +<td style="text-align:left">White</td> +<td style="text-align:left"><code>37</code></td> +<td style="text-align:left"><code>47</code></td> +</tr> +<tr> +<td style="text-align:left">Default</td> +<td style="text-align:left"><code>39</code></td> +<td style="text-align:left"><code>49</code></td> +</tr> +<tr> +<td style="text-align:left">Reset</td> +<td style="text-align:left"><code>0</code></td> +<td style="text-align:left"><code>0</code></td> +</tr> +</tbody> +</table> +<blockquote> +<p><strong>Note:</strong> the <em>Reset</em> color is the reset code that resets <em>all</em> colors and text effects, Use <em>Default</em> color to reset colors only.</p> +</blockquote> +<p>Most terminals, apart from the basic set of 8 colors, also support the “bright” or “bold” colors. These have their own set of codes, mirroring the normal colors, but with an additional <code>;1</code> in their codes:</p> +<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span><span style="font-style:italic"># Set style to bold, red foreground.</span> +</span></span><span style="display:flex;"><span><span style="font-weight:bold;font-style:italic">\x</span>1b[1;31mHello +</span></span><span style="display:flex;"><span><span style="font-style:italic"># Set style to dimmed white foreground with red background.</span> +</span></span><span style="display:flex;"><span><span style="font-weight:bold;font-style:italic">\x</span>1b[2;37;41mWorld +</span></span></code></pre></div><p>Terminals that support the <a href="https://sites.ualberta.ca/dept/chemeng/AIX-43/share/man/info/C/a_doc_lib/cmds/aixcmds1/aixterm.htm">aixterm specification</a> provides bright versions of the ISO colors, without the need to use the bold modifier:</p> +<table> +<thead> +<tr> +<th style="text-align:left">Color Name</th> +<th style="text-align:left">Foreground Color Code</th> +<th style="text-align:left">Background Color Code</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align:left">Bright Black</td> +<td style="text-align:left"><code>90</code></td> +<td style="text-align:left"><code>100</code></td> +</tr> +<tr> +<td style="text-align:left">Bright Red</td> +<td style="text-align:left"><code>91</code></td> +<td style="text-align:left"><code>101</code></td> +</tr> +<tr> +<td style="text-align:left">Bright Green</td> +<td style="text-align:left"><code>92</code></td> +<td style="text-align:left"><code>102</code></td> +</tr> +<tr> +<td style="text-align:left">Bright Yellow</td> +<td style="text-align:left"><code>93</code></td> +<td style="text-align:left"><code>103</code></td> +</tr> +<tr> +<td style="text-align:left">Bright Blue</td> +<td style="text-align:left"><code>94</code></td> +<td style="text-align:left"><code>104</code></td> +</tr> +<tr> +<td style="text-align:left">Bright Magenta</td> +<td style="text-align:left"><code>95</code></td> +<td style="text-align:left"><code>105</code></td> +</tr> +<tr> +<td style="text-align:left">Bright Cyan</td> +<td style="text-align:left"><code>96</code></td> +<td style="text-align:left"><code>106</code></td> +</tr> +<tr> +<td style="text-align:left">Bright White</td> +<td style="text-align:left"><code>97</code></td> +<td style="text-align:left"><code>107</code></td> +</tr> +</tbody> +</table> +<h4 id="256-colors">256 Colors</h4> +<p>The following escape codes tells the terminal to use the given color ID:</p> +<table> +<thead> +<tr> +<th style="text-align:left">ESC Code Sequence</th> +<th style="text-align:left">Description</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align:left"><code>ESC[38;5;{ID}m</code></td> +<td style="text-align:left">Set foreground color.</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[48;5;{ID}m</code></td> +<td style="text-align:left">Set background color.</td> +</tr> +</tbody> +</table> +<p>Where <code>{ID}</code> should be replaced with the color index from 0 to 255 of the following color table:</p> +<p><img src="https://user-images.githubusercontent.com/995050/47952855-ecb12480-df75-11e8-89d4-ac26c50e80b9.png" alt="256 Color table"></p> +<p>The table starts with the original 16 colors (0-15).</p> +<p>The proceeding 216 colors (16-231) or formed by a 3bpc RGB value offset by 16, packed into a single value.</p> +<p>The final 24 colors (232-255) are grayscale starting from a shade slighly lighter than black, ranging up to shade slightly darker than white.</p> +<p>Some emulators interpret these steps as linear increments (<code>256 / 24</code>) on all three channels, although some emulators may explicitly define these values.</p> +<h4 id="rgb-colors">RGB Colors</h4> +<p>More modern terminals supports <a href="https://en.wikipedia.org/wiki/Color_depth#True_color_.2824-bit.29">Truecolor</a> (24-bit RGB), which allows you to set foreground and background colors using RGB.</p> +<p>These escape sequences are usually not well documented.</p> +<table> +<thead> +<tr> +<th style="text-align:left">ESC Code Sequence</th> +<th style="text-align:left">Description</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align:left"><code>ESC[38;2;{r};{g};{b}m</code></td> +<td style="text-align:left">Set foreground color as RGB.</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[48;2;{r};{g};{b}m</code></td> +<td style="text-align:left">Set background color as RGB.</td> +</tr> +</tbody> +</table> +<blockquote> +<p>Note that <code>;38</code> and <code>;48</code> corresponds to the 16 color sequence and is interpreted by the terminal to set the foreground and background color respectively. Where as <code>;2</code> and <code>;5</code> sets the color format.</p> +</blockquote> +<h2 id="screen-modes">Screen Modes</h2> +<h3 id="set-mode">Set Mode</h3> +<table> +<thead> +<tr> +<th style="text-align:left">ESC Code Sequence</th> +<th style="text-align:left">Description</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align:left"><code>ESC[={value}h</code></td> +<td style="text-align:left">Changes the screen width or type to the mode specified by value.</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[=0h</code></td> +<td style="text-align:left">40 x 25 monochrome (text)</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[=1h</code></td> +<td style="text-align:left">40 x 25 color (text)</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[=2h</code></td> +<td style="text-align:left">80 x 25 monochrome (text)</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[=3h</code></td> +<td style="text-align:left">80 x 25 color (text)</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[=4h</code></td> +<td style="text-align:left">320 x 200 4-color (graphics)</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[=5h</code></td> +<td style="text-align:left">320 x 200 monochrome (graphics)</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[=6h</code></td> +<td style="text-align:left">640 x 200 monochrome (graphics)</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[=7h</code></td> +<td style="text-align:left">Enables line wrapping</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[=13h</code></td> +<td style="text-align:left">320 x 200 color (graphics)</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[=14h</code></td> +<td style="text-align:left">640 x 200 color (16-color graphics)</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[=15h</code></td> +<td style="text-align:left">640 x 350 monochrome (2-color graphics)</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[=16h</code></td> +<td style="text-align:left">640 x 350 color (16-color graphics)</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[=17h</code></td> +<td style="text-align:left">640 x 480 monochrome (2-color graphics)</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[=18h</code></td> +<td style="text-align:left">640 x 480 color (16-color graphics)</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[=19h</code></td> +<td style="text-align:left">320 x 200 color (256-color graphics)</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[={value}l</code></td> +<td style="text-align:left">Resets the mode by using the same values that Set Mode uses, except for 7, which disables line wrapping. The last character in this escape sequence is a lowercase L.</td> +</tr> +</tbody> +</table> +<h3 id="common-private-modes">Common Private Modes</h3> +<p>These are some examples of private modes, which are not defined by the specification, but are implemented in most terminals.</p> +<table> +<thead> +<tr> +<th style="text-align:left">ESC Code Sequence</th> +<th style="text-align:left">Description</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align:left"><code>ESC[?25l</code></td> +<td style="text-align:left">make cursor invisible</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[?25h</code></td> +<td style="text-align:left">make cursor visible</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[?47l</code></td> +<td style="text-align:left">restore screen</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[?47h</code></td> +<td style="text-align:left">save screen</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[?1049h</code></td> +<td style="text-align:left">enables the alternative buffer</td> +</tr> +<tr> +<td style="text-align:left"><code>ESC[?1049l</code></td> +<td style="text-align:left">disables the alternative buffer</td> +</tr> +</tbody> +</table> +<p>Refer to the <a href="https://invisible-island.net/xterm/ctlseqs/ctlseqs.html">XTerm Control Sequences</a> for a more in-depth list of private modes defined by XTerm.</p> +<blockquote> +<p>Note: While these modes may be supported by the most terminals, some may not work in multiplexers like tmux.</p> +</blockquote> +<h3 id="keyboard-strings">Keyboard Strings</h3> +<div class="highlight"><pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>ESC[{code};{string};{...}p +</span></span></code></pre></div><p>Redefines a keyboard key to a specified string.</p> +<p>The parameters for this escape sequence are defined as follows:</p> +<ul> +<li><code>code</code> is one or more of the values listed in the following table. These values represent keyboard keys and key combinations. When using these values in a command, you must type the semicolons shown in this table in addition to the semicolons required by the escape sequence. The codes in parentheses are not available on some keyboards. <code>ANSI.SYS</code> will not interpret the codes in parentheses for those keyboards unless you specify the <code>/X</code> switch in the <code>DEVICE</code> command for <code>ANSI.SYS</code>.</li> +<li><code>string</code> is either the ASCII code for a single character or a string contained in quotation marks. For example, both 65 and “A” can be used to represent an uppercase A.</li> +</ul> +<blockquote> +<p><strong>IMPORTANT:</strong> Some of the values in the following table are not valid for all computers. Check your computer’s documentation for values that are different.</p> +</blockquote> +<h4 id="list-of-keyboard-strings">List of keyboard strings</h4> +<table> +<thead> +<tr> +<th>Key</th> +<th>Code</th> +<th>SHIFT+code</th> +<th>CTRL+code</th> +<th>ALT+code</th> +</tr> +</thead> +<tbody> +<tr> +<td>F1</td> +<td>0;59</td> +<td>0;84</td> +<td>0;94</td> +<td>0;104</td> +</tr> +<tr> +<td>F2</td> +<td>0;60</td> +<td>0;85</td> +<td>0;95</td> +<td>0;105</td> +</tr> +<tr> +<td>F3</td> +<td>0;61</td> +<td>0;86</td> +<td>0;96</td> +<td>0;106</td> +</tr> +<tr> +<td>F4</td> +<td>0;62</td> +<td>0;87</td> +<td>0;97</td> +<td>0;107</td> +</tr> +<tr> +<td>F5</td> +<td>0;63</td> +<td>0;88</td> +<td>0;98</td> +<td>0;108</td> +</tr> +<tr> +<td>F6</td> +<td>0;64</td> +<td>0;89</td> +<td>0;99</td> +<td>0;109</td> +</tr> +<tr> +<td>F7</td> +<td>0;65</td> +<td>0;90</td> +<td>0;100</td> +<td>0;110</td> +</tr> +<tr> +<td>F8</td> +<td>0;66</td> +<td>0;91</td> +<td>0;101</td> +<td>0;111</td> +</tr> +<tr> +<td>F9</td> +<td>0;67</td> +<td>0;92</td> +<td>0;102</td> +<td>0;112</td> +</tr> +<tr> +<td>F10</td> +<td>0;68</td> +<td>0;93</td> +<td>0;103</td> +<td>0;113</td> +</tr> +<tr> +<td>F11</td> +<td>0;133</td> +<td>0;135</td> +<td>0;137</td> +<td>0;139</td> +</tr> +<tr> +<td>F12</td> +<td>0;134</td> +<td>0;136</td> +<td>0;138</td> +<td>0;140</td> +</tr> +<tr> +<td>HOME (num keypad)</td> +<td>0;71</td> +<td>55</td> +<td>0;119</td> +<td>--</td> +</tr> +<tr> +<td>UP ARROW (num keypad)</td> +<td>0;72</td> +<td>56</td> +<td>(0;141)</td> +<td>--</td> +</tr> +<tr> +<td>PAGE UP (num keypad)</td> +<td>0;73</td> +<td>57</td> +<td>0;132</td> +<td>--</td> +</tr> +<tr> +<td>LEFT ARROW (num keypad)</td> +<td>0;75</td> +<td>52</td> +<td>0;115</td> +<td>--</td> +</tr> +<tr> +<td>RIGHT ARROW (num keypad)</td> +<td>0;77</td> +<td>54</td> +<td>0;116</td> +<td>--</td> +</tr> +<tr> +<td>END (num keypad)</td> +<td>0;79</td> +<td>49</td> +<td>0;117</td> +<td>--</td> +</tr> +<tr> +<td>DOWN ARROW (num keypad)</td> +<td>0;80</td> +<td>50</td> +<td>(0;145)</td> +<td>--</td> +</tr> +<tr> +<td>PAGE DOWN (num keypad)</td> +<td>0;81</td> +<td>51</td> +<td>0;118</td> +<td>--</td> +</tr> +<tr> +<td>INSERT (num keypad)</td> +<td>0;82</td> +<td>48</td> +<td>(0;146)</td> +<td>--</td> +</tr> +<tr> +<td>DELETE (num keypad)</td> +<td>0;83</td> +<td>46</td> +<td>(0;147)</td> +<td>--</td> +</tr> +<tr> +<td>HOME</td> +<td>(224;71)</td> +<td>(224;71)</td> +<td>(224;119)</td> +<td>(224;151)</td> +</tr> +<tr> +<td>UP ARROW</td> +<td>(224;72)</td> +<td>(224;72)</td> +<td>(224;141)</td> +<td>(224;152)</td> +</tr> +<tr> +<td>PAGE UP</td> +<td>(224;73)</td> +<td>(224;73)</td> +<td>(224;132)</td> +<td>(224;153)</td> +</tr> +<tr> +<td>LEFT ARROW</td> +<td>(224;75)</td> +<td>(224;75)</td> +<td>(224;115)</td> +<td>(224;155)</td> +</tr> +<tr> +<td>RIGHT ARROW</td> +<td>(224;77)</td> +<td>(224;77)</td> +<td>(224;116)</td> +<td>(224;157)</td> +</tr> +<tr> +<td>END</td> +<td>(224;79)</td> +<td>(224;79)</td> +<td>(224;117)</td> +<td>(224;159)</td> +</tr> +<tr> +<td>DOWN ARROW</td> +<td>(224;80)</td> +<td>(224;80)</td> +<td>(224;145)</td> +<td>(224;154)</td> +</tr> +<tr> +<td>PAGE DOWN</td> +<td>(224;81)</td> +<td>(224;81)</td> +<td>(224;118)</td> +<td>(224;161)</td> +</tr> +<tr> +<td>INSERT</td> +<td>(224;82)</td> +<td>(224;82)</td> +<td>(224;146)</td> +<td>(224;162)</td> +</tr> +<tr> +<td>DELETE</td> +<td>(224;83)</td> +<td>(224;83)</td> +<td>(224;147)</td> +<td>(224;163)</td> +</tr> +<tr> +<td>PRINT SCREEN</td> +<td>--</td> +<td>--</td> +<td>0;114</td> +<td>--</td> +</tr> +<tr> +<td>PAUSE/BREAK</td> +<td>--</td> +<td>--</td> +<td>0;0</td> +<td>--</td> +</tr> +<tr> +<td>BACKSPACE</td> +<td>8</td> +<td>8</td> +<td>127</td> +<td>(0)</td> +</tr> +<tr> +<td>ENTER</td> +<td>13</td> +<td>--</td> +<td>10</td> +<td>(0</td> +</tr> +<tr> +<td>TAB</td> +<td>9</td> +<td>0;15</td> +<td>(0;148)</td> +<td>(0;165)</td> +</tr> +<tr> +<td>NULL</td> +<td>0;3</td> +<td>--</td> +<td>--</td> +<td>--</td> +</tr> +<tr> +<td>A</td> +<td>97</td> +<td>65</td> +<td>1</td> +<td>0;30</td> +</tr> +<tr> +<td>B</td> +<td>98</td> +<td>66</td> +<td>2</td> +<td>0;48</td> +</tr> +<tr> +<td>C</td> +<td>99</td> +<td>66</td> +<td>3</td> +<td>0;46</td> +</tr> +<tr> +<td>D</td> +<td>100</td> +<td>68</td> +<td>4</td> +<td>0;32</td> +</tr> +<tr> +<td>E</td> +<td>101</td> +<td>69</td> +<td>5</td> +<td>0;18</td> +</tr> +<tr> +<td>F</td> +<td>102</td> +<td>70</td> +<td>6</td> +<td>0;33</td> +</tr> +<tr> +<td>G</td> +<td>103</td> +<td>71</td> +<td>7</td> +<td>0;34</td> +</tr> +<tr> +<td>H</td> +<td>104</td> +<td>72</td> +<td>8</td> +<td>0;35</td> +</tr> +<tr> +<td>I</td> +<td>105</td> +<td>73</td> +<td>9</td> +<td>0;23</td> +</tr> +<tr> +<td>J</td> +<td>106</td> +<td>74</td> +<td>10</td> +<td>0;36</td> +</tr> +<tr> +<td>K</td> +<td>107</td> +<td>75</td> +<td>11</td> +<td>0;37</td> +</tr> +<tr> +<td>L</td> +<td>108</td> +<td>76</td> +<td>12</td> +<td>0;38</td> +</tr> +<tr> +<td>M</td> +<td>109</td> +<td>77</td> +<td>13</td> +<td>0;50</td> +</tr> +<tr> +<td>N</td> +<td>110</td> +<td>78</td> +<td>14</td> +<td>0;49</td> +</tr> +<tr> +<td>O</td> +<td>111</td> +<td>79</td> +<td>15</td> +<td>0;24</td> +</tr> +<tr> +<td>P</td> +<td>112</td> +<td>80</td> +<td>16</td> +<td>0;25</td> +</tr> +<tr> +<td>Q</td> +<td>113</td> +<td>81</td> +<td>17</td> +<td>0;16</td> +</tr> +<tr> +<td>R</td> +<td>114</td> +<td>82</td> +<td>18</td> +<td>0;19</td> +</tr> +<tr> +<td>S</td> +<td>115</td> +<td>83</td> +<td>19</td> +<td>0;31</td> +</tr> +<tr> +<td>T</td> +<td>116</td> +<td>84</td> +<td>20</td> +<td>0;20</td> +</tr> +<tr> +<td>U</td> +<td>117</td> +<td>85</td> +<td>21</td> +<td>0;22</td> +</tr> +<tr> +<td>V</td> +<td>118</td> +<td>86</td> +<td>22</td> +<td>0;47</td> +</tr> +<tr> +<td>W</td> +<td>119</td> +<td>87</td> +<td>23</td> +<td>0;17</td> +</tr> +<tr> +<td>X</td> +<td>120</td> +<td>88</td> +<td>24</td> +<td>0;45</td> +</tr> +<tr> +<td>Y</td> +<td>121</td> +<td>89</td> +<td>25</td> +<td>0;21</td> +</tr> +<tr> +<td>Z</td> +<td>122</td> +<td>90</td> +<td>26</td> +<td>0;44</td> +</tr> +<tr> +<td>1</td> +<td>49</td> +<td>33</td> +<td>--</td> +<td>0;120</td> +</tr> +<tr> +<td>2</td> +<td>50</td> +<td>64</td> +<td>0</td> +<td>0;121</td> +</tr> +<tr> +<td>3</td> +<td>51</td> +<td>35</td> +<td>--</td> +<td>0;122</td> +</tr> +<tr> +<td>4</td> +<td>52</td> +<td>36</td> +<td>--</td> +<td>0;123</td> +</tr> +<tr> +<td>5</td> +<td>53</td> +<td>37</td> +<td>--</td> +<td>0;124</td> +</tr> +<tr> +<td>6</td> +<td>54</td> +<td>94</td> +<td>30</td> +<td>0;125</td> +</tr> +<tr> +<td>7</td> +<td>55</td> +<td>38</td> +<td>--</td> +<td>0;126</td> +</tr> +<tr> +<td>8</td> +<td>56</td> +<td>42</td> +<td>--</td> +<td>0;126</td> +</tr> +<tr> +<td>9</td> +<td>57</td> +<td>40</td> +<td>--</td> +<td>0;127</td> +</tr> +<tr> +<td>0</td> +<td>48</td> +<td>41</td> +<td>--</td> +<td>0;129</td> +</tr> +<tr> +<td>-</td> +<td>45</td> +<td>95</td> +<td>31</td> +<td>0;130</td> +</tr> +<tr> +<td>=</td> +<td>61</td> +<td>43</td> +<td>-–</td> +<td>0;131</td> +</tr> +<tr> +<td>[</td> +<td>91</td> +<td>123</td> +<td>27</td> +<td>0;26</td> +</tr> +<tr> +<td>]</td> +<td>93</td> +<td>125</td> +<td>29</td> +<td>0;27</td> +</tr> +<tr> +<td></td> +<td>92</td> +<td>124</td> +<td>28</td> +<td>0;43</td> +</tr> +<tr> +<td>;</td> +<td>59</td> +<td>58</td> +<td>--</td> +<td>0;39</td> +</tr> +<tr> +<td>'</td> +<td>39</td> +<td>34</td> +<td>--</td> +<td>0;40</td> +</tr> +<tr> +<td>,</td> +<td>44</td> +<td>60</td> +<td>--</td> +<td>0;51</td> +</tr> +<tr> +<td>.</td> +<td>46</td> +<td>62</td> +<td>--</td> +<td>0;52</td> +</tr> +<tr> +<td>/</td> +<td>47</td> +<td>63</td> +<td>--</td> +<td>0;53</td> +</tr> +<tr> +<td>`</td> +<td>96</td> +<td>126</td> +<td>--</td> +<td>(0;41)</td> +</tr> +<tr> +<td>ENTER (keypad)</td> +<td>13</td> +<td>--</td> +<td>10</td> +<td>(0;166)</td> +</tr> +<tr> +<td>/ (keypad)</td> +<td>47</td> +<td>47</td> +<td>(0;142)</td> +<td>(0;74)</td> +</tr> +<tr> +<td>* (keypad)</td> +<td>42</td> +<td>(0;144)</td> +<td>(0;78)</td> +<td>--</td> +</tr> +<tr> +<td>- (keypad)</td> +<td>45</td> +<td>45</td> +<td>(0;149)</td> +<td>(0;164)</td> +</tr> +<tr> +<td>+ (keypad)</td> +<td>43</td> +<td>43</td> +<td>(0;150)</td> +<td>(0;55)</td> +</tr> +<tr> +<td>5 (keypad)</td> +<td>(0;76)</td> +<td>53</td> +<td>(0;143)</td> +<td>--</td> +</tr> +</tbody> +</table> +<h2 id="resources">Resources</h2> +<ul> +<li><a href="https://en.wikipedia.org/wiki/ANSI_escape_code">Wikipedia: ANSI escape code</a></li> +<li><a href="http://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html">Build your own Command Line with ANSI escape codes</a></li> +<li><a href="http://ascii-table.com/ansi-escape-sequences.php">ascii-table: ANSI Escape sequences</a></li> +<li><a href="https://bluesock.org/~willkg/dev/ansi.html">bluesock: ansi codes</a></li> +<li><a href="http://wiki.bash-hackers.org/scripting/terminalcodes">bash-hackers: Terminal Codes (ANSI/VT100) introduction</a></li> +<li><a href="https://invisible-island.net/xterm/ctlseqs/ctlseqs.html">XTerm Control Sequences</a></li> +<li><a href="https://vt100.net/">VT100 – Various terminal manuals</a></li> +<li><a href="https://xtermjs.org/docs/api/vtfeatures/">xterm.js – Supported Terminal Sequences</a></li> +</ul> + + </div> + + <div class="row"> + <div class="col-xs-12"> + + </div> + </div> + + + <div style="height: 50px;"></div> + + + <div class="site-footer"> + + + +</div> + + </div> + </div> + </article> + + + +<script> + + + + + +</script> + + + +</body> + +</html> |