Console Virtual Terminal Sequences - Windows Console.html 85 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146
  1. <!DOCTYPE html>
  2. <html class="hasSidebar hasPageActions hasBreadcrumb conceptual has-default-focus theme-light" lang="en-us" dir="ltr" data-css-variable-support="true" data-authenticated="false" data-auth-status-determined="false" data-target="docs" x-ms-format-detection="none">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <meta property="og:title" content="Console Virtual Terminal Sequences - Windows Console" />
  7. <meta property="og:type" content="website" />
  8. <meta property="og:url" content="https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences" />
  9. <meta property="og:description" content="Virtual terminal sequences are control character sequences that can control cursor movement, color/font mode, and other operations when written to the output stream." />
  10. <meta property="og:image" content="https://docs.microsoft.com/en-us/media/logos/logo-ms-social.png" />
  11. <meta property="og:image:alt" content="Microsoft Logo" />
  12. <meta name="twitter:card" content="summary" />
  13. <meta name="twitter:site" content="@docsmsft" />
  14. <meta name="author" content="bitcrazed" />
  15. <meta name="breadcrumb_path" content="/windows/console/breadcrumb/toc.json" />
  16. <meta name="depot_name" content="MSDN.console" />
  17. <meta name="description" content="Virtual terminal sequences are control character sequences that can control cursor movement, color/font mode, and other operations when written to the output stream." />
  18. <meta name="document_id" content="fc536527-f75d-5a03-7b5a-338a08e40d2f" />
  19. <meta name="document_version_independent_id" content="097f43d9-243f-466e-1f99-6cfa1f4bfb1f" />
  20. <meta name="gitcommit" content="https://github.com/MicrosoftDocs/Console-Docs/blob/5cca96a7f2833c54e226c41344a620cc1c253be6/docs/console-virtual-terminal-sequences.md" />
  21. <meta name="keywords" content="console, character mode applications, command line applications, terminal applications, console api" />
  22. <meta name="locale" content="en-us" />
  23. <meta name="ms.assetid" content="A5C553A5-FD84-4D16-A814-EDB3B8699B91" />
  24. <meta name="ms.author" content="richturn" />
  25. <meta name="ms.date" content="07/12/2018" />
  26. <meta name="ms.prod" content="console" />
  27. <meta name="ms.topic" content="article" />
  28. <meta name="MSHAttr" content="PreferredSiteName:MSDN" />
  29. <meta name="MSHAttr" content="PreferredLib:/library/windows/desktop" />
  30. <meta name="original_content_git_url" content="https://github.com/MicrosoftDocs/Console-Docs/blob/live/docs/console-virtual-terminal-sequences.md" />
  31. <meta name="search.ms_docsetname" content="console" />
  32. <meta name="search.ms_product" content="MSDN" />
  33. <meta name="search.ms_sitename" content="Docs" />
  34. <meta name="site_name" content="Docs" />
  35. <meta name="updated_at" content="2020-06-24 04:09 PM" />
  36. <meta name="page_type" content="conceptual" />
  37. <meta name="toc_rel" content="toc.json" />
  38. <meta name="word_count" content="5220" />
  39. <meta name="scope" content="Console" />
  40. <link href="https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences" rel="canonical">
  41. <title>Console Virtual Terminal Sequences - Windows Console | Microsoft Docs</title>
  42. <link rel="stylesheet" href="/_themes/docs.theme/master/en-us/_themes/styles/62c7ff0c.site-ltr.css ">
  43. <link rel="stylesheet" href="/_themes/docs.theme/master/en-us/_themes/styles/5a8a71c1.conceptual.css ">
  44. <script>
  45. var msDocs = {
  46. data: {
  47. timeOrigin: Date.now(),
  48. contentLocale: 'en-us',
  49. contentDir: 'ltr',
  50. userLocale: 'en-us',
  51. userDir: 'ltr',
  52. pageTemplate: 'Conceptual',
  53. brand: '',
  54. context: {
  55. },
  56. hasBinaryRating: true,
  57. hasGithubIssues: true,
  58. showFeedbackReport: false,
  59. enableTutorialFeedback: false,
  60. feedbackSystem: 'GitHub',
  61. feedbackGitHubRepo: 'MicrosoftDocs/Console-Docs',
  62. feedbackProductUrl: 'https://github.com/microsoft/console/issues',
  63. contentGitUrl: 'https://github.com/Microsoft/Console-Docs/blob/master/docs/console-virtual-terminal-sequences.md',
  64. extendBreadcrumb: true,
  65. isEditDisplayable: true,
  66. hideViewSource: false,
  67. hasPageActions: true,
  68. hasBookmark: true,
  69. hasShare: true
  70. },
  71. functions:{}
  72. };
  73. </script>
  74. <script nomodule src="/static/third-party/bluebird/3.5.0/bluebird.min.js" integrity="sha384-aD4BDeDGeLXLpPK4yKeqtZQa9dv4a/7mQ+4L5vwshIYH1Mc2BrXvHd32iHzYCQy5" crossorigin="anonymous"></script>
  75. <script nomodule src="/static/third-party/fetch/3.0.0/fetch.umd.min.js" integrity="sha384-EQIXrC5K2+7X8nGgLkB995I0/6jfAvvyG1ieZ+WYGxgJHFMD/alsG9fSDWvzb5Y1" crossorigin="anonymous"></script>
  76. <script nomodule src="/static/third-party/template/1.4.0/template.min.js" integrity="sha384-1zKzI6ldTVHMU7n0W2HpE/lhHI+UG4D9IIaxbj3kT2UhCWicdTuJkTtnKuu0CQzN" crossorigin="anonymous"></script>
  77. <script nomodule src="/static/third-party/url/0.5.7/url.min.js" integrity="sha384-vn7xBMtpSTfzaTRWxj0kVq0UcsbBrTOgZ/M1ISHqe1V358elYva+lfiEC+T8jLPc" crossorigin="anonymous"></script>
  78. <script src="/_themes/docs.theme/master/en-us/_themes/scripts/7501e2bd.index-polyfills.js"></script>
  79. <script src="/_themes/docs.theme/master/en-us/_themes/scripts/55f6956b.index-docs.js"></script>
  80. </head>
  81. <body lang="en-us" dir="ltr">
  82. <div class="header-holder has-default-focus">
  83. <a href="#main" class="skip-to-main-link has-outline-color-text visually-hidden-until-focused is-fixed has-inner-focus focus-visible has-top-zero has-left-zero has-right-zero has-padding-medium has-text-centered has-body-background-medium" tabindex="1">Skip to main content</a>
  84. <div id="headerAreaHolder" data-bi-name="header">
  85. <header role="banner" itemscope="itemscope" itemtype="http://schema.org/Organization">
  86. <div class="nav-bar">
  87. <div class="nav-bar-brand">
  88. <a itemprop="url" href="https://www.microsoft.com" aria-label="Microsoft" class="nav-bar-button">
  89. <div class="nav-bar-logo has-background-image theme-display is-light" role="presentation" aria-hidden="true" itemprop="logo" itemscope="itemscope"></div>
  90. <div class="nav-bar-logo has-background-image theme-display is-dark is-high-contrast" role="presentation" aria-hidden="true" itemprop="logo" itemscope="itemscope"></div>
  91. </a>
  92. </div>
  93. <div class="nav-bar-item is-hidden-tablet">
  94. <button class="nav-bar-button nav-bar-menu" title="Global navigation">
  95. <span class="nav-bar-menu-title"></span>
  96. <div class="nav-bar-burger">
  97. <span></span>
  98. <span></span>
  99. <span></span>
  100. <span class="nav-bar-burger-label">Global navigation</span>
  101. </div>
  102. </button>
  103. </div>
  104. <nav class="nav-bar-nav" role="navigation" aria-label="Global">
  105. <ul class="nav-bar-nav-list">
  106. <li class="nav-bar-item is-category">
  107. <a class="nav-bar-button is-title has-hover-underline" itemprop="url" href="/en-us/">
  108. <span>Docs</span>
  109. </a>
  110. </li>
  111. <li class="nav-bar-item">
  112. <a class="nav-bar-button has-hover-underline" href="/en-us/">
  113. <span>Documentation</span>
  114. </a>
  115. </li>
  116. <li class="nav-bar-item">
  117. <a class="nav-bar-button has-hover-underline" href="/en-us/learn/">
  118. <span>Learn</span>
  119. </a>
  120. </li>
  121. <li class="nav-bar-item">
  122. <a class="nav-bar-button has-hover-underline" href="/en-us/samples/browse/">
  123. <span>Code Samples</span>
  124. </a>
  125. </li>
  126. <li class="dropdown nav-bar-item" hidden="">
  127. <button aria-expanded="false" class="dropdown-trigger nav-bar-button has-hover-underline" aria-controls="ax-53">
  128. <span>More</span>
  129. <span class="nav-bar-button-chevron" aria-hidden="true">
  130. <span class="docon docon-chevron-down-light expanded-indicator"></span>
  131. </span>
  132. </button>
  133. <ul class="dropdown-menu" id="ax-53" aria-label="More">
  134. <li class="nav-bar-item" hidden="">
  135. <a class="nav-bar-button" href="/en-us/">Documentation</a>
  136. </li>
  137. <li class="nav-bar-item" hidden="">
  138. <a class="nav-bar-button" href="/en-us/learn/">Learn</a>
  139. </li>
  140. <li class="nav-bar-item" hidden="">
  141. <a class="nav-bar-button" href="/en-us/samples/browse/">Code Samples</a>
  142. </li>
  143. </ul>
  144. </li>
  145. </ul>
  146. </nav>
  147. <span class="nav-bar-spacer"></span>
  148. <div class="nav-bar-item">
  149. </div>
  150. <div class="nav-bar-item is-size-small is-hidden-mobile">
  151. </div>
  152. </div>
  153. <div class="nav-bar is-content">
  154. </div>
  155. </header> </div>
  156. <div class="content-header uhf-container has-padding has-default-focus has-border-bottom-none" data-bi-name="content-header">
  157. <nav class="has-padding-none has-padding-left-medium-tablet has-padding-right-medium-tablet has-padding-left-none-uhf-tablet has-padding-left-none-uhf-tablet has-padding-none-desktop has-flex-grow" data-bi-name="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList" role="navigation" aria-label="Breadcrumb">
  158. <ul id="page-breadcrumbs" class="breadcrumbs">
  159. </ul>
  160. </nav>
  161. <div class="content-header-controls">
  162. <button type="button" class="contents-button button" data-bi-name="contents-expand" aria-haspopup="true">
  163. <span class="icon"><span class="docon docon-menu" aria-hidden="true"></span></span>
  164. <span class="contents-expand-title">Contents</span>
  165. </button>
  166. <button type="button" class="ap-collapse-behavior ap-expanded button" data-bi-name="ap-collapse" aria-controls="action-panel">
  167. <span class="icon"><span class="docon docon-exit-mode" aria-hidden="true"></span></span>
  168. <span>Exit focus mode</span>
  169. </button>
  170. </div>
  171. <div class="has-padding-none-tablet has-padding-medium is-size-small is-flex-touch has-flex-justify-content-space-between-touch has-flex-grow">
  172. <ul class="is-hidden-mobile action-list has-flex-justify-content-start has-flex-justify-content-end-tablet is-flex is-flex-row has-flex-wrap has-flex-grow is-unstyled">
  173. <li>
  174. <button type="button" class="bookmark button is-text has-inner-focus is-small is-icon-only-touch" data-list-type="bookmarks" data-bi-name="bookmark" title="Bookmark this page">
  175. <span class="icon" aria-hidden="true">
  176. <span class="docon docon-single-bookmark"></span>
  177. </span>
  178. <span class="bookmark-status is-visually-hidden-touch is-hidden-portrait">Bookmark</span>
  179. </button>
  180. </li>
  181. <li id="feedback-section-link">
  182. <a href="#feedback" class="button is-text has-inner-focus is-small is-icon-only-touch" data-bi-name="comments" title="Send feedback about this page">
  183. <span class="icon">
  184. <span class="docon docon-comment-lines" aria-hidden="true"></span>
  185. </span>
  186. <span class="is-visually-hidden-touch is-hidden-portrait">Feedback</span>
  187. </a>
  188. </li>
  189. <li id="contenteditbtn">
  190. <a href="https://github.com/Microsoft/Console-Docs/blob/master/docs/console-virtual-terminal-sequences.md" class="button is-text has-inner-focus is-icon-only-touch is-small" title="Edit This Document" data-bi-name="edit" data-original_content_git_url="https://github.com/MicrosoftDocs/Console-Docs/blob/live/docs/console-virtual-terminal-sequences.md" data-original_content_git_url_template="{repo}/blob/{branch}/docs/console-virtual-terminal-sequences.md" data-pr_repo="" data-pr_branch="">
  191. <span class="icon">
  192. <span class="docon docon-edit-outline" aria-hidden="true"></span>
  193. </span>
  194. <span class="is-visually-hidden-touch is-hidden-portrait">Edit</span>
  195. </a>
  196. </li>
  197. <li>
  198. <div class="sharing dropdown has-caret">
  199. <button class="dropdown-trigger button is-text is-fullwidth has-flex-justify-content-start has-inner-focus is-small is-icon-only-touch" aria-controls="sharing-menu" aria-expanded="false" title="Share This Document" data-bi-name="share">
  200. <span class="icon" aria-hidden="true">
  201. <span class="docon docon-sharing"></span>
  202. </span>
  203. <span class="is-visually-hidden-touch is-hidden-portrait">Share</span>
  204. </button>
  205. <div class="dropdown-menu has-padding-small" id="sharing-menu">
  206. <ul data-bi-name="share-links">
  207. <li>
  208. <a class="button is-text is-fullwidth has-flex-justify-content-start has-inner-focus is-small share-twitter" data-bi-name="twitter">
  209. <span class="icon">
  210. <span class="docon docon-brand-twitter has-text-primary" aria-hidden="true"></span>
  211. </span>
  212. <span>Twitter</span>
  213. </a>
  214. </li>
  215. <li>
  216. <a class="button is-text is-fullwidth has-flex-justify-content-start has-inner-focus is-small share-linkedin" data-bi-name="linkedin">
  217. <span class="icon">
  218. <span class="docon docon-brand-linkedin has-text-primary" aria-hidden="true"></span>
  219. </span>
  220. <span>LinkedIn</span>
  221. </a>
  222. </li>
  223. <li>
  224. <a class="button is-text is-fullwidth has-flex-justify-content-start has-inner-focus is-small share-facebook" data-bi-name="facebook">
  225. <span class="icon">
  226. <span class="docon docon-brand-facebook has-text-primary" aria-hidden="true"></span>
  227. </span>
  228. <span>Facebook</span>
  229. </a>
  230. </li>
  231. <li>
  232. <a class="button is-text is-fullwidth has-flex-justify-content-start has-inner-focus is-small share-email" data-bi-name="email">
  233. <span class="icon">
  234. <span class="docon docon-mail-message-fill has-text-primary" aria-hidden="true"></span>
  235. </span>
  236. <span>Email</span>
  237. </a>
  238. </li>
  239. </ul>
  240. </div>
  241. </div> </li>
  242. </ul>
  243. <button type="button" class="has-border contents-button button is-small is-text is-hidden-tablet has-inner-focus" aria-label="Contents" data-bi-name="contents-expand">
  244. <span class="icon">
  245. <span class="docon docon-editor-list-bullet" aria-hidden="true"></span>
  246. </span>
  247. <span class="contents-expand-title">Table of contents</span>
  248. </button>
  249. <div class="is-invisible"></div>
  250. <div class="is-hidden-tablet level-item is-flexible level-right">
  251. <button type="button" class="page-actions-button button is-small is-text is-hidden-tablet has-inner-focus has-border is-full-height has-margin-left-small" aria-label="Page Actions" data-bi-name="pageactions">
  252. <span class="icon">
  253. <span class="docon docon-more-vertical" aria-hidden="true"></span>
  254. </span>
  255. </button>
  256. </div>
  257. </div>
  258. </div>
  259. <div id="disclaimer-holder" class="has-overflow-hidden has-default-focus"></div>
  260. </div>
  261. <div class="mainContainer uhf-container has-top-padding has-default-focus" data-bi-name="body">
  262. <div class="columns has-large-gaps is-gapless-mobile ">
  263. <div id="left-container" class="left-container is-hidden-mobile column is-one-third-tablet is-one-quarter-desktop">
  264. <nav id="affixed-left-container" class="is-fixed is-flex is-flex-column" role="navigation" aria-label="Primary"></nav>
  265. </div>
  266. <section class="primary-holder column is-two-thirds-tablet is-three-quarters-desktop">
  267. <div class="columns is-gapless-mobile has-large-gaps ">
  268. <div id="main-column" class="column is-full is-four-fifths-desktop ">
  269. <main id="main" role="main" class="content " data-bi-name="content" lang="en-us" dir="ltr">
  270. <h1 id="console-virtual-terminal-sequences">Console Virtual Terminal Sequences</h1>
  271. <ul class="metadata page-metadata" data-bi-name="page info" lang="en-us" dir="ltr">
  272. <li>
  273. <time class="is-invisible" data-article-date aria-label="Article review date" datetime="2018-07-12T00:00:00.000Z" data-article-date-source="ms.date">07/12/2018</time>
  274. </li>
  275. <li class="readingTime">26 minutes to read</li>
  276. <li class="contributors-holder">
  277. <a href="https://github.com/Microsoft/Console-Docs/blob/master/docs/console-virtual-terminal-sequences.md" title="10 Contributors" aria-label="10 Contributors">
  278. <ul class="contributors" data-bi-name="contributors" aria-hidden="true">
  279. <li><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNMsAcAAQUAoVnxsV8AAAAASUVORK5CYII=" data-src="https://github.com/bitcrazed.png?size=32" role="presentation"/></li>
  280. <li><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNMsAcAAQUAoVnxsV8AAAAASUVORK5CYII=" data-src="https://github.com/GoBigorGoHome.png?size=32" role="presentation"/></li>
  281. <li><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNMsAcAAQUAoVnxsV8AAAAASUVORK5CYII=" data-src="https://github.com/miniksa.png?size=32" role="presentation"/></li>
  282. <li><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNMsAcAAQUAoVnxsV8AAAAASUVORK5CYII=" data-src="https://github.com/zadjii-msft.png?size=32" role="presentation"/></li>
  283. <li><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNMsAcAAQUAoVnxsV8AAAAASUVORK5CYII=" data-src="https://github.com/JPRuskin.png?size=32" role="presentation"/></li>
  284. <li><span class="is-size-extra-small has-text-subtle">+5</span></li>
  285. </ul>
  286. </a>
  287. </li>
  288. </ul>
  289. <nav id="center-doc-outline" class="doc-outline is-hidden-desktop" data-bi-name="intopic toc" role="navigation" aria-label="Article Outline">
  290. <h3>In this article</h3>
  291. </nav>
  292. <!-- <content> -->
  293. <p>Virtual terminal sequences are control character sequences that can control cursor movement, color/font mode, and other operations when written to the output stream. Sequences may also be received on the input stream in response to an output stream query information sequence or as an encoding of user input when the appropriate mode is set.</p>
  294. <p>You can use <a href="getconsolemode" data-linktype="relative-path"><strong>GetConsoleMode</strong></a> and <a href="setconsolemode" data-linktype="relative-path"><strong>SetConsoleMode</strong></a> functions to configure this behavior. A sample of the suggested way to enable virtual terminal behaviors is included at the end of this document.</p>
  295. <p>The behavior of the following sequences is based on the VT100 and derived terminal emulator technologies, most specifically the xterm terminal emulator. More information about terminal sequences can be found at <a href="http://vt100.net" data-linktype="external">http://vt100.net</a> and at <a href="http://invisible-island.net/xterm/ctlseqs/ctlseqs.html" data-linktype="external">http://invisible-island.net/xterm/ctlseqs/ctlseqs.html</a>.</p>
  296. <h2 id="output-sequences"><span id="Output_Sequences"></span><span id="output_sequences"></span><span id="OUTPUT_SEQUENCES"></span>Output Sequences</h2>
  297. <p>The following terminal sequences are intercepted by the console host when written into the output stream, if the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag is set on the screen buffer handle using the <a href="setconsolemode" data-linktype="relative-path"><strong>SetConsoleMode</strong></a> function. Note that the DISABLE_NEWLINE_AUTO_RETURN flag may also be useful in emulating the cursor positioning and scrolling behavior of other terminal emulators in relation to characters written to the final column in any row.</p>
  298. <h2 id="simple-cursor-positioning"><span id="Simple_Cursor_Positioning"></span><span id="simple_cursor_positioning"></span><span id="SIMPLE_CURSOR_POSITIONING"></span>Simple Cursor Positioning</h2>
  299. <p>In all of the following descriptions, ESC is always the hexadecimal value 0x1B. No spaces are to be included in terminal sequences. For an example of how these sequences are used in practice, please see the <a href="#example" data-linktype="self-bookmark">example</a> at the end of this topic.</p>
  300. <p>The following table describes simple escape sequences with a single action command directly after the ESC character. These sequences have no parameters and take effect immediately.</p>
  301. <p>All commands in this table are generally equivalent to calling the <a href="setconsolecursorposition" data-linktype="relative-path"><strong>SetConsoleCursorPosition</strong></a> console API to place the cursor.</p>
  302. <p>Cursor movement will be bounded by the current viewport into the buffer. Scrolling (if available) will not occur.</p>
  303. <table>
  304. <thead>
  305. <tr>
  306. <th>Sequence</th>
  307. <th>Shorthand</th>
  308. <th>Behavior</th>
  309. </tr>
  310. </thead>
  311. <tbody>
  312. <tr>
  313. <td>ESC A</td>
  314. <td>CUU</td>
  315. <td>Cursor Up by 1</td>
  316. </tr>
  317. <tr>
  318. <td>ESC B</td>
  319. <td>CUD</td>
  320. <td>Cursor Down by 1</td>
  321. </tr>
  322. <tr>
  323. <td>ESC C</td>
  324. <td>CUF</td>
  325. <td>Cursor Forward (Right) by 1</td>
  326. </tr>
  327. <tr>
  328. <td>ESC D</td>
  329. <td>CUB</td>
  330. <td>Cursor Backward (Left) by 1</td>
  331. </tr>
  332. <tr>
  333. <td>ESC M</td>
  334. <td>RI</td>
  335. <td>Reverse Index – Performs the reverse operation of \n, moves cursor up one line, maintains horizontal position, scrolls buffer if necessary*</td>
  336. </tr>
  337. <tr>
  338. <td>ESC 7</td>
  339. <td>DECSC</td>
  340. <td>Save Cursor Position in Memory**</td>
  341. </tr>
  342. <tr>
  343. <td>ESC 8</td>
  344. <td>DECSR</td>
  345. <td>Restore Cursor Position from Memory**</td>
  346. </tr>
  347. </tbody>
  348. </table>
  349. <p><strong>Note</strong><br/>
  350. * If there are scroll margins set, RI inside the margins will scroll only the contents of the margins, and leave the viewport unchanged. (See Scrolling Margins)</p>
  351. <p>**There will be no value saved in memory until the first use of the save command. The only way to access the saved value is with the restore command.</p>
  352. <h2 id="cursor-positioning"><span id="Cursor_Positioning"></span><span id="cursor_positioning"></span><span id="CURSOR_POSITIONING"></span>Cursor Positioning</h2>
  353. <p>The following tables encompass Control Sequence Introducer (CSI) type sequences. All CSI sequences start with ESC (0x1B) followed by [ (left bracket, 0x5B) and may contain parameters of variable length to specify more information for each operation. This will be represented by the shorthand &lt;n&gt;. Each table below is grouped by functionality with notes below each table explaining how the group works.</p>
  354. <p>For all parameters, the following rules apply unless otherwise noted:</p>
  355. <ul>
  356. <li>&lt;n&gt; represents the distance to move and is an optional parameter</li>
  357. <li>If &lt;n&gt; is omitted or equals 0, it will be treated as a 1</li>
  358. <li>&lt;n&gt; cannot be larger than 32,767 (maximum short value)</li>
  359. <li>&lt;n&gt; cannot be negative</li>
  360. </ul>
  361. <p>All commands in this section are generally equivalent to calling the <a href="setconsolecursorposition" data-linktype="relative-path"><strong>SetConsoleCursorPosition</strong></a> console API.</p>
  362. <p>Cursor movement will be bounded by the current viewport into the buffer. Scrolling (if available) will not occur.</p>
  363. <table>
  364. <thead>
  365. <tr>
  366. <th>Sequence</th>
  367. <th>Code</th>
  368. <th>Description</th>
  369. <th>Behavior</th>
  370. </tr>
  371. </thead>
  372. <tbody>
  373. <tr>
  374. <td>ESC [ &lt;n&gt; A</td>
  375. <td>CUU</td>
  376. <td>Cursor Up</td>
  377. <td>Cursor up by &lt;n&gt;</td>
  378. </tr>
  379. <tr>
  380. <td>ESC [ &lt;n&gt; B</td>
  381. <td>CUD</td>
  382. <td>Cursor Down</td>
  383. <td>Cursor down by &lt;n&gt;</td>
  384. </tr>
  385. <tr>
  386. <td>ESC [ &lt;n&gt; C</td>
  387. <td>CUF</td>
  388. <td>Cursor Forward</td>
  389. <td>Cursor forward (Right) by &lt;n&gt;</td>
  390. </tr>
  391. <tr>
  392. <td>ESC [ &lt;n&gt; D</td>
  393. <td>CUB</td>
  394. <td>Cursor Backward</td>
  395. <td>Cursor backward (Left) by &lt;n&gt;</td>
  396. </tr>
  397. <tr>
  398. <td>ESC [ &lt;n&gt; E</td>
  399. <td>CNL</td>
  400. <td>Cursor Next Line</td>
  401. <td>Cursor down to beginning of &lt;n&gt;th line in the viewport</td>
  402. </tr>
  403. <tr>
  404. <td>ESC [ &lt;n&gt; F</td>
  405. <td>CPL</td>
  406. <td>Cursor Previous Line</td>
  407. <td>Cursor up to beginning of &lt;n&gt;th line in the viewport</td>
  408. </tr>
  409. <tr>
  410. <td>ESC [ &lt;n&gt; G</td>
  411. <td>CHA</td>
  412. <td>Cursor Horizontal Absolute</td>
  413. <td>Cursor moves to &lt;n&gt;th position horizontally in the current line</td>
  414. </tr>
  415. <tr>
  416. <td>ESC [ &lt;n&gt; d</td>
  417. <td>VPA</td>
  418. <td>Vertical Line Position Absolute</td>
  419. <td>Cursor moves to the &lt;n&gt;th position vertically in the current column</td>
  420. </tr>
  421. <tr>
  422. <td>ESC [ &lt;y&gt; ; &lt;x&gt; H</td>
  423. <td>CUP</td>
  424. <td>Cursor Position</td>
  425. <td>*Cursor moves to &lt;x&gt;; &lt;y&gt; coordinate within the viewport, where &lt;x&gt; is the column of the &lt;y&gt; line</td>
  426. </tr>
  427. <tr>
  428. <td>ESC [ &lt;y&gt; ; &lt;x&gt; f</td>
  429. <td>HVP</td>
  430. <td>Horizontal Vertical Position</td>
  431. <td>*Cursor moves to &lt;x&gt;; &lt;y&gt; coordinate within the viewport, where &lt;x&gt; is the column of the &lt;y&gt; line</td>
  432. </tr>
  433. <tr>
  434. <td>ESC [ s</td>
  435. <td>ANSISYSSC</td>
  436. <td>Save Cursor – Ansi.sys emulation</td>
  437. <td>**With no parameters, performs a save cursor operation like DECSC</td>
  438. </tr>
  439. <tr>
  440. <td>ESC [ u</td>
  441. <td>ANSISYSSC</td>
  442. <td>Restore Cursor – Ansi.sys emulation</td>
  443. <td>**With no parameters, performs a restore cursor operation like DECRC</td>
  444. </tr>
  445. </tbody>
  446. </table>
  447. <p><strong>Note</strong><br/>
  448. *&lt;x&gt; and &lt;y&gt; parameters have the same limitations as &lt;n&gt; above. If &lt;x&gt; and &lt;y&gt; are omitted, they will be set to 1;1.</p>
  449. <p>**ANSI.sys historical documentation can be found at <a href="https://msdn.microsoft.com/library/cc722862.aspx" data-linktype="external">https://msdn.microsoft.com/library/cc722862.aspx</a> and is implemented for convenience/compatibility.</p>
  450. <h2 id="cursor-visibility"><span id="Cursor_Visibility"></span><span id="cursor_visibility"></span><span id="CURSOR_VISIBILITY"></span>Cursor Visibility</h2>
  451. <p>The following commands control the visibility of the cursor and its blinking state. The DECTCEM sequences are generally equivalent to calling <a href="setconsolecursorinfo" data-linktype="relative-path"><strong>SetConsoleCursorInfo</strong></a> console API to toggle cursor visibility.</p>
  452. <table>
  453. <thead>
  454. <tr>
  455. <th>Sequence</th>
  456. <th>Code</th>
  457. <th>Description</th>
  458. <th>Behavior</th>
  459. </tr>
  460. </thead>
  461. <tbody>
  462. <tr>
  463. <td>ESC [ ? 12 h</td>
  464. <td>ATT160</td>
  465. <td>Text Cursor Enable Blinking</td>
  466. <td>Start the cursor blinking</td>
  467. </tr>
  468. <tr>
  469. <td>ESC [ ? 12 l</td>
  470. <td>ATT160</td>
  471. <td>Text Cursor Disable Blinking</td>
  472. <td>Stop blinking the cursor</td>
  473. </tr>
  474. <tr>
  475. <td>ESC [ ? 25 h</td>
  476. <td>DECTCEM</td>
  477. <td>Text Cursor Enable Mode Show</td>
  478. <td>Show the cursor</td>
  479. </tr>
  480. <tr>
  481. <td>ESC [ ? 25 l</td>
  482. <td>DECTCEM</td>
  483. <td>Text Cursor Enable Mode Hide</td>
  484. <td>Hide the cursor</td>
  485. </tr>
  486. </tbody>
  487. </table>
  488. <h2 id="viewport-positioning"><span id="Viewport_Positioning"></span><span id="viewport_positioning"></span><span id="VIEWPORT_POSITIONING"></span>Viewport Positioning</h2>
  489. <p>All commands in this section are generally equivalent to calling <a href="scrollconsolescreenbuffer" data-linktype="relative-path"><strong>ScrollConsoleScreenBuffer</strong></a> console API to move the contents of the console buffer.</p>
  490. <p><strong>Caution</strong> The command names are misleading. Scroll refers to which direction the text moves during the operation, not which way the viewport would seem to move.</p>
  491. <table>
  492. <thead>
  493. <tr>
  494. <th>Sequence</th>
  495. <th>Code</th>
  496. <th>Description</th>
  497. <th>Behavior</th>
  498. </tr>
  499. </thead>
  500. <tbody>
  501. <tr>
  502. <td>ESC [ &lt;n&gt; S</td>
  503. <td>SU</td>
  504. <td>Scroll Up</td>
  505. <td>Scroll text up by &lt;n&gt;. Also known as pan down, new lines fill in from the bottom of the screen</td>
  506. </tr>
  507. <tr>
  508. <td>ESC [ &lt;n&gt; T</td>
  509. <td>SD</td>
  510. <td>Scroll Down</td>
  511. <td>Scroll down by &lt;n&gt;. Also known as pan up, new lines fill in from the top of the screen</td>
  512. </tr>
  513. </tbody>
  514. </table>
  515. <p>The text is moved starting with the line the cursor is on. If the cursor is on the middle row of the viewport, then scroll up would move the bottom half of the viewport, and insert blank lines at the bottom. Scroll down would move the top half of the viewport’s rows, and insert new lines at the top.</p>
  516. <p>Also important to note is scroll up and down are also affected by the scrolling margins. Scroll up and down won’t affect any lines outside the scrolling margins.</p>
  517. <p>The default value for &lt;n&gt; is 1, and the value can be optionally omitted.</p>
  518. <h2 id="text-modification"><span id="Text_Modification"></span><span id="text_modification"></span><span id="TEXT_MODIFICATION"></span>Text Modification</h2>
  519. <p>All commands in this section are generally equivalent to calling <a href="fillconsoleoutputcharacter" data-linktype="relative-path"><strong>FillConsoleOutputCharacter</strong></a>, <a href="fillconsoleoutputattribute" data-linktype="relative-path"><strong>FillConsoleOutputAttribute</strong></a>, and <a href="scrollconsolescreenbuffer" data-linktype="relative-path"><strong>ScrollConsoleScreenBuffer</strong></a> console APIs to modify the text buffer contents.</p>
  520. <table>
  521. <thead>
  522. <tr>
  523. <th>Sequence</th>
  524. <th>Code</th>
  525. <th>Description</th>
  526. <th>Behavior</th>
  527. </tr>
  528. </thead>
  529. <tbody>
  530. <tr>
  531. <td>ESC [ &lt;n&gt; @</td>
  532. <td>ICH</td>
  533. <td>Insert Character</td>
  534. <td>Insert &lt;n&gt; spaces at the current cursor position, shifting all existing text to the right. Text exiting the screen to the right is removed.</td>
  535. </tr>
  536. <tr>
  537. <td>ESC [ &lt;n&gt; P</td>
  538. <td>DCH</td>
  539. <td>Delete Character</td>
  540. <td>Delete &lt;n&gt; characters at the current cursor position, shifting in space characters from the right edge of the screen.</td>
  541. </tr>
  542. <tr>
  543. <td>ESC [ &lt;n&gt; X</td>
  544. <td>ECH</td>
  545. <td>Erase Character</td>
  546. <td>Erase &lt;n&gt; characters from the current cursor position by overwriting them with a space character.</td>
  547. </tr>
  548. <tr>
  549. <td>ESC [ &lt;n&gt; L</td>
  550. <td>IL</td>
  551. <td>Insert Line</td>
  552. <td>Inserts &lt;n&gt; lines into the buffer at the cursor position. The line the cursor is on, and lines below it, will be shifted downwards.</td>
  553. </tr>
  554. <tr>
  555. <td>ESC [ &lt;n&gt; M</td>
  556. <td>DL</td>
  557. <td>Delete Line</td>
  558. <td>Deletes &lt;n&gt; lines from the buffer, starting with the row the cursor is on.</td>
  559. </tr>
  560. </tbody>
  561. </table>
  562. <p><strong>Note</strong><br/>
  563. For IL and DL, only the lines in the scrolling margins (see Scrolling Margins) are affected. If no margins are set, the default margin borders are the current viewport. If lines would be shifted below the margins, they are discarded. When lines are deleted, blank lines are inserted at the bottom of the margins, lines from outside the viewport are never affected.</p>
  564. <p>For each of the sequences, the default value for &lt;n&gt; if it is omitted is 0.</p>
  565. <p>For the following commands, the parameter &lt;n&gt; has 3 valid values:</p>
  566. <ul>
  567. <li>0 erases from the current cursor position (inclusive) to the end of the line/display</li>
  568. <li>1 erases from the beginning of the line/display up to and including the current cursor position</li>
  569. <li>2 erases the entire line/display</li>
  570. </ul>
  571. <table>
  572. <thead>
  573. <tr>
  574. <th>Sequence</th>
  575. <th>Code</th>
  576. <th>Description</th>
  577. <th>Behavior</th>
  578. </tr>
  579. </thead>
  580. <tbody>
  581. <tr>
  582. <td>ESC [ &lt;n&gt; J</td>
  583. <td>ED</td>
  584. <td>Erase in Display</td>
  585. <td>Replace all text in the current viewport/screen specified by &lt;n&gt; with space characters</td>
  586. </tr>
  587. <tr>
  588. <td>ESC [ &lt;n&gt; K</td>
  589. <td>EL</td>
  590. <td>Erase in Line</td>
  591. <td>Replace all text on the line with the cursor specified by &lt;n&gt; with space characters</td>
  592. </tr>
  593. </tbody>
  594. </table>
  595. <h2 id="text-formatting"><span id="Text_Formatting"></span><span id="text_formatting"></span><span id="TEXT_FORMATTING"></span>Text Formatting</h2>
  596. <p>All commands in this section are generally equivalent to calling <a href="setconsoletextattribute" data-linktype="relative-path"><strong>SetConsoleTextAttribute</strong></a> console APIs to adjust the formatting of all future writes to the console output text buffer.</p>
  597. <p>This command is special in that the &lt;n&gt; position below can accept between 0 and 16 parameters separated by semicolons.</p>
  598. <p>When no parameters are specified, it is treated the same as a single 0 parameter.</p>
  599. <table>
  600. <thead>
  601. <tr>
  602. <th>Sequence</th>
  603. <th>Code</th>
  604. <th>Description</th>
  605. <th>Behavior</th>
  606. </tr>
  607. </thead>
  608. <tbody>
  609. <tr>
  610. <td>ESC [ &lt;n&gt; m</td>
  611. <td>SGR</td>
  612. <td>Set Graphics Rendition</td>
  613. <td>Set the format of the screen and text as specified by &lt;n&gt;</td>
  614. </tr>
  615. </tbody>
  616. </table>
  617. <p>The following table of values can be used in &lt;n&gt; to represent different formatting modes.</p>
  618. <p>Formatting modes are applied from left to right. Applying competing formatting options will result in the right-most option taking precedence.</p>
  619. <p>For options that specify colors, the colors will be used as defined in the console color table which can be modified using the <a href="setconsolescreenbufferinfoex" data-linktype="relative-path"><strong>SetConsoleScreenBufferInfoEx</strong></a> API. If the table is modified to make the “blue” position in the table display an RGB shade of red, then all calls to <strong>Foreground Blue</strong> will display that red color until otherwise changed.</p>
  620. <table>
  621. <thead>
  622. <tr>
  623. <th>Value</th>
  624. <th>Description</th>
  625. <th>Behavior</th>
  626. </tr>
  627. </thead>
  628. <tbody>
  629. <tr>
  630. <td>0</td>
  631. <td>Default</td>
  632. <td>Returns all attributes to the default state prior to modification</td>
  633. </tr>
  634. <tr>
  635. <td>1</td>
  636. <td>Bold/Bright</td>
  637. <td>Applies brightness/intensity flag to foreground color</td>
  638. </tr>
  639. <tr>
  640. <td>4</td>
  641. <td>Underline</td>
  642. <td>Adds underline</td>
  643. </tr>
  644. <tr>
  645. <td>24</td>
  646. <td>No underline</td>
  647. <td>Removes underline</td>
  648. </tr>
  649. <tr>
  650. <td>7</td>
  651. <td>Negative</td>
  652. <td>Swaps foreground and background colors</td>
  653. </tr>
  654. <tr>
  655. <td>27</td>
  656. <td>Positive (No negative)</td>
  657. <td>Returns foreground/background to normal</td>
  658. </tr>
  659. <tr>
  660. <td>30</td>
  661. <td>Foreground Black</td>
  662. <td>Applies non-bold/bright black to foreground</td>
  663. </tr>
  664. <tr>
  665. <td>31</td>
  666. <td>Foreground Red</td>
  667. <td>Applies non-bold/bright red to foreground</td>
  668. </tr>
  669. <tr>
  670. <td>32</td>
  671. <td>Foreground Green</td>
  672. <td>Applies non-bold/bright green to foreground</td>
  673. </tr>
  674. <tr>
  675. <td>33</td>
  676. <td>Foreground Yellow</td>
  677. <td>Applies non-bold/bright yellow to foreground</td>
  678. </tr>
  679. <tr>
  680. <td>34</td>
  681. <td>Foreground Blue</td>
  682. <td>Applies non-bold/bright blue to foreground</td>
  683. </tr>
  684. <tr>
  685. <td>35</td>
  686. <td>Foreground Magenta</td>
  687. <td>Applies non-bold/bright magenta to foreground</td>
  688. </tr>
  689. <tr>
  690. <td>36</td>
  691. <td>Foreground Cyan</td>
  692. <td>Applies non-bold/bright cyan to foreground</td>
  693. </tr>
  694. <tr>
  695. <td>37</td>
  696. <td>Foreground White</td>
  697. <td>Applies non-bold/bright white to foreground</td>
  698. </tr>
  699. <tr>
  700. <td>38</td>
  701. <td>Foreground Extended</td>
  702. <td>Applies extended color value to the foreground (see details below)</td>
  703. </tr>
  704. <tr>
  705. <td>39</td>
  706. <td>Foreground Default</td>
  707. <td>Applies only the foreground portion of the defaults (see 0)</td>
  708. </tr>
  709. <tr>
  710. <td>40</td>
  711. <td>Background Black</td>
  712. <td>Applies non-bold/bright black to background</td>
  713. </tr>
  714. <tr>
  715. <td>41</td>
  716. <td>Background Red</td>
  717. <td>Applies non-bold/bright red to background</td>
  718. </tr>
  719. <tr>
  720. <td>42</td>
  721. <td>Background Green</td>
  722. <td>Applies non-bold/bright green to background</td>
  723. </tr>
  724. <tr>
  725. <td>43</td>
  726. <td>Background Yellow</td>
  727. <td>Applies non-bold/bright yellow to background</td>
  728. </tr>
  729. <tr>
  730. <td>44</td>
  731. <td>Background Blue</td>
  732. <td>Applies non-bold/bright blue to background</td>
  733. </tr>
  734. <tr>
  735. <td>45</td>
  736. <td>Background Magenta</td>
  737. <td>Applies non-bold/bright magenta to background</td>
  738. </tr>
  739. <tr>
  740. <td>46</td>
  741. <td>Background Cyan</td>
  742. <td>Applies non-bold/bright cyan to background</td>
  743. </tr>
  744. <tr>
  745. <td>47</td>
  746. <td>Background White</td>
  747. <td>Applies non-bold/bright white to background</td>
  748. </tr>
  749. <tr>
  750. <td>48</td>
  751. <td>Background Extended</td>
  752. <td>Applies extended color value to the background (see details below)</td>
  753. </tr>
  754. <tr>
  755. <td>49</td>
  756. <td>Background Default</td>
  757. <td>Applies only the background portion of the defaults (see 0)</td>
  758. </tr>
  759. <tr>
  760. <td>90</td>
  761. <td>Bright Foreground Black</td>
  762. <td>Applies bold/bright black to foreground</td>
  763. </tr>
  764. <tr>
  765. <td>91</td>
  766. <td>Bright Foreground Red</td>
  767. <td>Applies bold/bright red to foreground</td>
  768. </tr>
  769. <tr>
  770. <td>92</td>
  771. <td>Bright Foreground Green</td>
  772. <td>Applies bold/bright green to foreground</td>
  773. </tr>
  774. <tr>
  775. <td>93</td>
  776. <td>Bright Foreground Yellow</td>
  777. <td>Applies bold/bright yellow to foreground</td>
  778. </tr>
  779. <tr>
  780. <td>94</td>
  781. <td>Bright Foreground Blue</td>
  782. <td>Applies bold/bright blue to foreground</td>
  783. </tr>
  784. <tr>
  785. <td>95</td>
  786. <td>Bright Foreground Magenta</td>
  787. <td>Applies bold/bright magenta to foreground</td>
  788. </tr>
  789. <tr>
  790. <td>96</td>
  791. <td>Bright Foreground Cyan</td>
  792. <td>Applies bold/bright cyan to foreground</td>
  793. </tr>
  794. <tr>
  795. <td>97</td>
  796. <td>Bright Foreground White</td>
  797. <td>Applies bold/bright white to foreground</td>
  798. </tr>
  799. <tr>
  800. <td>100</td>
  801. <td>Bright Background Black</td>
  802. <td>Applies bold/bright black to background</td>
  803. </tr>
  804. <tr>
  805. <td>101</td>
  806. <td>Bright Background Red</td>
  807. <td>Applies bold/bright red to background</td>
  808. </tr>
  809. <tr>
  810. <td>102</td>
  811. <td>Bright Background Green</td>
  812. <td>Applies bold/bright green to background</td>
  813. </tr>
  814. <tr>
  815. <td>103</td>
  816. <td>Bright Background Yellow</td>
  817. <td>Applies bold/bright yellow to background</td>
  818. </tr>
  819. <tr>
  820. <td>104</td>
  821. <td>Bright Background Blue</td>
  822. <td>Applies bold/bright blue to background</td>
  823. </tr>
  824. <tr>
  825. <td>105</td>
  826. <td>Bright Background Magenta</td>
  827. <td>Applies bold/bright magenta to background</td>
  828. </tr>
  829. <tr>
  830. <td>106</td>
  831. <td>Bright Background Cyan</td>
  832. <td>Applies bold/bright cyan to background</td>
  833. </tr>
  834. <tr>
  835. <td>107</td>
  836. <td>Bright Background White</td>
  837. <td>Applies bold/bright white to background</td>
  838. </tr>
  839. </tbody>
  840. </table>
  841. <h3 id="extended-colors"><span id="Extended_Colors"></span><span id="extended_colors"></span><span id="EXTENDED_COLORS"></span>Extended Colors</h3>
  842. <p>Some virtual terminal emulators support a palette of colors greater than the 16 colors provided by the Windows Console. For these extended colors, the Windows Console will choose the nearest appropriate color from the existing 16 color table for display. Unlike typical SGR values above, the extended values will consume additional parameters after the initial indicator according to the table below.</p>
  843. <table>
  844. <thead>
  845. <tr>
  846. <th>SGR Subsequence</th>
  847. <th>Description</th>
  848. </tr>
  849. </thead>
  850. <tbody>
  851. <tr>
  852. <td>38 ; 2 ; &lt;r&gt; ; &lt;g&gt; ; &lt;b&gt;</td>
  853. <td>Set foreground color to RGB value specified in &lt;r&gt;, &lt;g&gt;, &lt;b&gt; parameters*</td>
  854. </tr>
  855. <tr>
  856. <td>48 ; 2 ; &lt;r&gt; ; &lt;g&gt; ; &lt;b&gt;</td>
  857. <td>Set background color to RGB value specified in &lt;r&gt;, &lt;g&gt;, &lt;b&gt; parameters*</td>
  858. </tr>
  859. <tr>
  860. <td>38 ; 5 ; &lt;s&gt;</td>
  861. <td>Set foreground color to &lt;s&gt; index in 88 or 256 color table*</td>
  862. </tr>
  863. <tr>
  864. <td>48 ; 5 ; &lt;s&gt;</td>
  865. <td>Set background color to &lt;s&gt; index in 88 or 256 color table*</td>
  866. </tr>
  867. </tbody>
  868. </table>
  869. <p>*The 88 and 256 color palettes maintained internally for comparison are based from the xterm terminal emulator. The comparison/rounding tables cannot be modified at this time.</p>
  870. <h2 id="screen-colors"><span id="Screen_Colors"></span><span id="screen_colors"></span><span id="SCREEN_COLORS"></span>Screen Colors</h2>
  871. <p>The following command allows the application to set the screen colors palette values to any RGB value.</p>
  872. <p>The RGB values should be hexadecimal values between <code>0</code> and <code>ff</code>, and separated by the forward-slash character (e.g. <code>rgb:1/24/86</code>).</p>
  873. <p>Note that this sequence is an OSC “Operating system command” sequence, and not a CSI like many of the other sequences listed, and as such start with “\x1b]”, not “\x1b[”.</p>
  874. <table>
  875. <thead>
  876. <tr>
  877. <th>Sequence</th>
  878. <th>Description</th>
  879. <th>Behavior</th>
  880. </tr>
  881. </thead>
  882. <tbody>
  883. <tr>
  884. <td>ESC ] 4 ; &lt;i&gt; ; rgb : &lt;r&gt; / &lt;g&gt; / &lt;b&gt; ESC</td>
  885. <td>Modify Screen Colors</td>
  886. <td>Sets the screen color palette index &lt;i&gt; to the RGB values specified in &lt;r&gt;, &lt;g&gt;, &lt;b&gt;</td>
  887. </tr>
  888. </tbody>
  889. </table>
  890. <h2 id="mode-changes"><span id="Mode_Changes__"></span><span id="mode_changes__"></span><span id="MODE_CHANGES__"></span>Mode Changes</h2>
  891. <p>These are sequences that control the input modes. There are two different sets of input modes, the Cursor Keys Mode and the Keypad Keys Mode. The Cursor Keys Mode controls the sequences that are emitted by the arrow keys as well as Home and End, while the Keypad Keys Mode controls the sequences emitted by the keys on the numpad primarily, as well as the function keys.</p>
  892. <p>Each of these modes are simple boolean settings – the Cursor Keys Mode is either Normal (default) or Application, and the Keypad Keys Mode is either Numeric (default) or Application.</p>
  893. <p>See the Cursor Keys and Numpad &amp; Function Keys sections for the sequences emitted in these modes.</p>
  894. <table>
  895. <thead>
  896. <tr>
  897. <th>Sequence</th>
  898. <th>Code</th>
  899. <th>Description</th>
  900. <th>Behavior</th>
  901. </tr>
  902. </thead>
  903. <tbody>
  904. <tr>
  905. <td>ESC =</td>
  906. <td>DECKPAM</td>
  907. <td>Enable Keypad Application Mode</td>
  908. <td>Keypad keys will emit their Application Mode sequences.</td>
  909. </tr>
  910. <tr>
  911. <td>ESC &gt;</td>
  912. <td>DECKPNM</td>
  913. <td>Enable Keypad Numeric Mode</td>
  914. <td>Keypad keys will emit their Numeric Mode sequences.</td>
  915. </tr>
  916. <tr>
  917. <td>ESC [ ? 1 h</td>
  918. <td>DECCKM</td>
  919. <td>Enable Cursor Keys Application Mode</td>
  920. <td>Keypad keys will emit their Application Mode sequences.</td>
  921. </tr>
  922. <tr>
  923. <td>ESC [ ? 1 l</td>
  924. <td>DECCKM</td>
  925. <td>Disable Cursor Keys Application Mode (use Normal Mode)</td>
  926. <td>Keypad keys will emit their Numeric Mode sequences.</td>
  927. </tr>
  928. </tbody>
  929. </table>
  930. <h2 id="query-state"><span id="Query_State"></span><span id="query_state"></span><span id="QUERY_STATE"></span>Query State</h2>
  931. <p>All commands in this section are generally equivalent to calling Get* console APIs to retrieve status information about the current console buffer state.</p>
  932. <p><strong>Note</strong> These queries will emit their responses into the console input stream immediately after being recognized on the output stream while ENABLE_VIRTUAL_TERMINAL_PROCESSING is set. The ENABLE_VIRTUAL_TERMINAL_INPUT flag does not apply to query commands as it is assumed that an application making the query will always want to receive the reply.</p>
  933. <table>
  934. <thead>
  935. <tr>
  936. <th>Sequence</th>
  937. <th>Code</th>
  938. <th>Description</th>
  939. <th>Behavior</th>
  940. </tr>
  941. </thead>
  942. <tbody>
  943. <tr>
  944. <td>ESC [ 6 n</td>
  945. <td>DECXCPR</td>
  946. <td>Report Cursor Position</td>
  947. <td>Emit the cursor position as: ESC [ &lt;r&gt; ; &lt;c&gt; R Where &lt;r&gt; = cursor row and &lt;c&gt; = cursor column</td>
  948. </tr>
  949. <tr>
  950. <td>ESC [ 0 c</td>
  951. <td>DA</td>
  952. <td>Device Attributes</td>
  953. <td>Report the terminal identity. Will emit “\x1b[?1;0c”, indicating &quot;VT101 with No Options&quot;.</td>
  954. </tr>
  955. </tbody>
  956. </table>
  957. <h2 id="tabs"><span id="Tabs"></span><span id="tabs"></span><span id="TABS"></span>Tabs</h2>
  958. <p>While the windows console traditionally expects tabs to be exclusively eight characters wide, *nix applications utilizing certain sequences can manipulate where the tab stops are within the console windows to optimize cursor movement by the application.</p>
  959. <p>The following sequences allow an application to set the tab stop locations within the console window, remove them, and navigate between them.</p>
  960. <table>
  961. <thead>
  962. <tr>
  963. <th>Sequence</th>
  964. <th>Code</th>
  965. <th>Description</th>
  966. <th>Behavior</th>
  967. </tr>
  968. </thead>
  969. <tbody>
  970. <tr>
  971. <td>ESC H</td>
  972. <td>HTS</td>
  973. <td>Horizontal Tab Set</td>
  974. <td>Sets a tab stop in the current column the cursor is in.</td>
  975. </tr>
  976. <tr>
  977. <td>ESC [ &lt;n&gt; I</td>
  978. <td>CHT</td>
  979. <td>Cursor Horizontal (Forward) Tab</td>
  980. <td>Advance the cursor to the next column (in the same row) with a tab stop. If there are no more tab stops, move to the last column in the row. If the cursor is in the last column, move to the first column of the next row.</td>
  981. </tr>
  982. <tr>
  983. <td>ESC [ &lt;n&gt; Z</td>
  984. <td>CBT</td>
  985. <td>Cursor Backwards Tab</td>
  986. <td>Move the cursor to the previous column (in the same row) with a tab stop. If there are no more tab stops, moves the cursor to the first column. If the cursor is in the first column, doesn’t move the cursor.</td>
  987. </tr>
  988. <tr>
  989. <td>ESC [ 0 g</td>
  990. <td>TBC</td>
  991. <td>Tab Clear (current column)</td>
  992. <td>Clears the tab stop in the current column, if there is one. Otherwise does nothing.</td>
  993. </tr>
  994. <tr>
  995. <td>ESC [ 3 g</td>
  996. <td>TBC</td>
  997. <td>Tab Clear (all columns)</td>
  998. <td>Clears all currently set tab stops.</td>
  999. </tr>
  1000. </tbody>
  1001. </table>
  1002. <ul>
  1003. <li>For both CHT and CBT, &lt;n&gt; is an optional parameter that (default=1) indicating how many times to advance the cursor in the specified direction.</li>
  1004. <li>If there are no tab stops set via HTS, CHT and CBT will treat the first and last columns of the window as the only two tab stops.</li>
  1005. <li>Using HTS to set a tab stop will also cause the console to navigate to the next tab stop on the output of a TAB (0x09, ‘\t’) character, in the same manner as CHT.</li>
  1006. </ul>
  1007. <h2 id="designate-character-set"><span id="Designate_Character_Set"></span><span id="designate_character_set"></span><span id="DESIGNATE_CHARACTER_SET"></span>Designate Character Set</h2>
  1008. <p>The following sequences allow a program to change the active character set mapping. This allows a program to emit 7-bit ASCII characters, but have them displayed as other glyphs on the terminal screen itself. Currently, the only two supported character sets are ASCII (default) and the DEC Special Graphics Character Set. See <a href="http://vt100.net/docs/vt220-rm/table2-4.html" data-linktype="external">http://vt100.net/docs/vt220-rm/table2-4.html</a> for a listing of all of the characters represented by the DEC Special Graphics Character Set.</p>
  1009. <table>
  1010. <thead>
  1011. <tr>
  1012. <th>Sequence</th>
  1013. <th>Description</th>
  1014. <th>Behavior</th>
  1015. </tr>
  1016. </thead>
  1017. <tbody>
  1018. <tr>
  1019. <td>ESC ( 0</td>
  1020. <td>Designate Character Set – DEC Line Drawing</td>
  1021. <td>Enables DEC Line Drawing Mode</td>
  1022. </tr>
  1023. <tr>
  1024. <td>ESC ( B</td>
  1025. <td>Designate Character Set – US ASCII</td>
  1026. <td>Enables ASCII Mode (Default)</td>
  1027. </tr>
  1028. </tbody>
  1029. </table>
  1030. <p>Notably, the DEC Line Drawing mode is used for drawing borders in console applications. The following table shows what ASCII character maps to which line drawing character.</p>
  1031. <table>
  1032. <thead>
  1033. <tr>
  1034. <th>Hex</th>
  1035. <th>ASCII</th>
  1036. <th>DEC Line Drawing</th>
  1037. </tr>
  1038. </thead>
  1039. <tbody>
  1040. <tr>
  1041. <td>0x6a</td>
  1042. <td>j</td>
  1043. <td>┘</td>
  1044. </tr>
  1045. <tr>
  1046. <td>0x6b</td>
  1047. <td>k</td>
  1048. <td>┐</td>
  1049. </tr>
  1050. <tr>
  1051. <td>0x6c</td>
  1052. <td>l</td>
  1053. <td>┌</td>
  1054. </tr>
  1055. <tr>
  1056. <td>0x6d</td>
  1057. <td>m</td>
  1058. <td>└</td>
  1059. </tr>
  1060. <tr>
  1061. <td>0x6e</td>
  1062. <td>n</td>
  1063. <td>┼</td>
  1064. </tr>
  1065. <tr>
  1066. <td>0x71</td>
  1067. <td>q</td>
  1068. <td>─</td>
  1069. </tr>
  1070. <tr>
  1071. <td>0x74</td>
  1072. <td>t</td>
  1073. <td>├</td>
  1074. </tr>
  1075. <tr>
  1076. <td>0x75</td>
  1077. <td>u</td>
  1078. <td>┤</td>
  1079. </tr>
  1080. <tr>
  1081. <td>0x76</td>
  1082. <td>v</td>
  1083. <td>┴</td>
  1084. </tr>
  1085. <tr>
  1086. <td>0x77</td>
  1087. <td>w</td>
  1088. <td>┬</td>
  1089. </tr>
  1090. <tr>
  1091. <td>0x78</td>
  1092. <td>x</td>
  1093. <td>│</td>
  1094. </tr>
  1095. </tbody>
  1096. </table>
  1097. <h2 id="scrolling-margins"><span id="Scrolling_Margins"></span><span id="scrolling_margins"></span><span id="SCROLLING_MARGINS"></span>Scrolling Margins</h2>
  1098. <p>The following sequences allow a program to configure the “scrolling region” of the screen that is affected by scrolling operations. This is a subset of the rows that are adjusted when the screen would otherwise scroll, for example, on a ‘\n’ or RI. These margins also affect the rows modified by Insert Line (IL) and Delete Line (DL), Scroll Up (SU) and Scroll Down (SD).</p>
  1099. <p>The scrolling margins can be especially useful for having a portion of the screen that doesn’t scroll when the rest of the screen is filled, such as having a title bar at the top or a status bar at the bottom of your application.</p>
  1100. <p>For DECSTBM, there are two optional parameters, &lt;t&gt; and &lt;b&gt;, which are used to specify the rows that represent the top and bottom lines of the scroll region, inclusive. If the parameters are omitted, &lt;t&gt; defaults to 1 and &lt;b&gt; defaults to the current viewport height.</p>
  1101. <p>Scrolling margins are per-buffer, so importantly, the Alternate Buffer and Main Buffer maintain separate scrolling margins settings (so a full screen application in the alternate buffer will not poison the main buffer’s margins).</p>
  1102. <table>
  1103. <thead>
  1104. <tr>
  1105. <th>Sequence</th>
  1106. <th>Code</th>
  1107. <th>Description</th>
  1108. <th>Behavior</th>
  1109. </tr>
  1110. </thead>
  1111. <tbody>
  1112. <tr>
  1113. <td>ESC [ &lt;t&gt; ; &lt;b&gt; r</td>
  1114. <td>DECSTBM</td>
  1115. <td>Set Scrolling Region</td>
  1116. <td>Sets the VT scrolling margins of the viewport.</td>
  1117. </tr>
  1118. </tbody>
  1119. </table>
  1120. <h2 id="window-title"><span id="Window_Title"></span><span id="window_title"></span><span id="WINDOW_TITLE"></span>Window Title</h2>
  1121. <p>The following commands allows the application to set the title of the console window to the given &lt;string&gt; parameter. The string must be less than 255 characters to be accepted. This is equivalent to calling SetConsoleTitle with the given string.</p>
  1122. <p>Note that these sequences are OSC “Operating system command” sequences, and not a CSI like many of the other sequences listed, and as such starts with “\x1b]”, not “\x1b[”.</p>
  1123. <table>
  1124. <thead>
  1125. <tr>
  1126. <th>Sequence</th>
  1127. <th>Description</th>
  1128. <th>Behavior</th>
  1129. </tr>
  1130. </thead>
  1131. <tbody>
  1132. <tr>
  1133. <td>ESC ] 0 ; &lt;string&gt; BEL</td>
  1134. <td>Set Icon and Window Title</td>
  1135. <td>Sets the console window’s title to &lt;string&gt;.</td>
  1136. </tr>
  1137. <tr>
  1138. <td>ESC ] 2 ; &lt;string&gt; BEL</td>
  1139. <td>Set Window Title</td>
  1140. <td>Sets the console window’s title to &lt;string&gt;.</td>
  1141. </tr>
  1142. </tbody>
  1143. </table>
  1144. <p>The terminating character here is the “Bell” character, ‘\x07’</p>
  1145. <h2 id="alternate-screen-buffer"><span id="Alternate_Screen_Buffer__"></span><span id="alternate_screen_buffer__"></span><span id="ALTERNATE_SCREEN_BUFFER__"></span>Alternate Screen Buffer</h2>
  1146. <p>*Nix style applications often utilize an alternate screen buffer, so that they can modify the entire contents of the buffer, without affecting the application that started them. The alternate buffer is exactly the dimensions of the window, without any scrollback region.</p>
  1147. <p>For an example of this behavior, consider when vim is launched from bash. Vim uses the entirety of the screen to edit the file, then returning to bash leaves the original buffer unchanged.</p>
  1148. <table>
  1149. <thead>
  1150. <tr>
  1151. <th>Sequence</th>
  1152. <th>Description</th>
  1153. <th>Behavior</th>
  1154. </tr>
  1155. </thead>
  1156. <tbody>
  1157. <tr>
  1158. <td>ESC [ ? 1 0 4 9 h</td>
  1159. <td>Use Alternate Screen Buffer</td>
  1160. <td>Switches to a new alternate screen buffer.</td>
  1161. </tr>
  1162. <tr>
  1163. <td>ESC [ ? 1 0 4 9 l</td>
  1164. <td>Use Main Screen Buffer</td>
  1165. <td>Switches to the main buffer.</td>
  1166. </tr>
  1167. </tbody>
  1168. </table>
  1169. <h2 id="window-width"><span id="Window_Width"></span><span id="window_width"></span><span id="WINDOW_WIDTH"></span>Window Width</h2>
  1170. <p>The following sequences can be used to control the width of the console window. They are roughly equivalent to the calling the SetConsoleScreenBufferInfoEx console API to set the window width.</p>
  1171. <table>
  1172. <thead>
  1173. <tr>
  1174. <th>Sequence</th>
  1175. <th>Code</th>
  1176. <th>Description</th>
  1177. <th>Behavior</th>
  1178. </tr>
  1179. </thead>
  1180. <tbody>
  1181. <tr>
  1182. <td>ESC [ ? 3 h</td>
  1183. <td>DECCOLM</td>
  1184. <td>Set Number of Columns to 132</td>
  1185. <td>Sets the console width to 132 columns wide.</td>
  1186. </tr>
  1187. <tr>
  1188. <td>ESC [ ? 3 l</td>
  1189. <td>DECCOLM</td>
  1190. <td>Set Number of Columns to 80</td>
  1191. <td>Sets the console width to 80 columns wide.</td>
  1192. </tr>
  1193. </tbody>
  1194. </table>
  1195. <h2 id="soft-reset"><span id="Soft_Reset"></span><span id="soft_reset"></span><span id="SOFT_RESET"></span>Soft Reset</h2>
  1196. <p>The following sequence can be used to reset certain properties to their default values.The following properties are reset to the following default values (also listed are the sequences that control those properties):</p>
  1197. <ul>
  1198. <li>Cursor visibility: visible (DECTEM)</li>
  1199. <li>Numeric Keypad: Numeric Mode (DECNKM)</li>
  1200. <li>Cursor Keys Mode: Normal Mode (DECCKM)</li>
  1201. <li>Top and Bottom Margins: Top=1, Bottom=Console height (DECSTBM)</li>
  1202. <li>Character Set: US ASCII</li>
  1203. <li>Graphics Rendition: Default/Off (SGR)</li>
  1204. <li>Save cursor state: Home position (0,0) (DECSC)</li>
  1205. </ul>
  1206. <table>
  1207. <thead>
  1208. <tr>
  1209. <th>Sequence</th>
  1210. <th>Code</th>
  1211. <th>Description</th>
  1212. <th>Behavior</th>
  1213. </tr>
  1214. </thead>
  1215. <tbody>
  1216. <tr>
  1217. <td>ESC [ ! p</td>
  1218. <td>DECSTR</td>
  1219. <td>Soft Reset</td>
  1220. <td>Reset certain terminal settings to their defaults.</td>
  1221. </tr>
  1222. </tbody>
  1223. </table>
  1224. <h2 id="input-sequences"><span id="Input_Sequences"></span><span id="input_sequences"></span><span id="INPUT_SEQUENCES"></span>Input Sequences</h2>
  1225. <p>The following terminal sequences are emitted by the console host on the input stream if the ENABLE_VIRTUAL_TERMINAL_INPUT flag is set on the input buffer handle using the SetConsoleMode flag.</p>
  1226. <p>There are two internal modes that control which sequences are emitted for the given input keys, the Cursor Keys Mode and the Keypad Keys Mode. These are described in the Mode Changes section.</p>
  1227. <h3 id="cursor-keys"><span id="Cursor_Keys__"></span><span id="cursor_keys__"></span><span id="CURSOR_KEYS__"></span>Cursor Keys</h3>
  1228. <table>
  1229. <thead>
  1230. <tr>
  1231. <th>Key</th>
  1232. <th>Normal Mode</th>
  1233. <th>Application Mode</th>
  1234. </tr>
  1235. </thead>
  1236. <tbody>
  1237. <tr>
  1238. <td>Up Arrow</td>
  1239. <td>ESC [ A</td>
  1240. <td>ESC O A</td>
  1241. </tr>
  1242. <tr>
  1243. <td>Down Arrow</td>
  1244. <td>ESC [ B</td>
  1245. <td>ESC O B</td>
  1246. </tr>
  1247. <tr>
  1248. <td>Right Arrow</td>
  1249. <td>ESC [ C</td>
  1250. <td>ESC O C</td>
  1251. </tr>
  1252. <tr>
  1253. <td>Left Arrow</td>
  1254. <td>ESC [ D</td>
  1255. <td>ESC O D</td>
  1256. </tr>
  1257. <tr>
  1258. <td>Home</td>
  1259. <td>ESC [ H</td>
  1260. <td>ESC O H</td>
  1261. </tr>
  1262. <tr>
  1263. <td>End</td>
  1264. <td>ESC [ F</td>
  1265. <td>ESC O F</td>
  1266. </tr>
  1267. </tbody>
  1268. </table>
  1269. <p>Additionally, if Ctrl is pressed with any of these keys, the following sequences are emitted instead, regardless of the Cursor Keys Mode:</p>
  1270. <table>
  1271. <thead>
  1272. <tr>
  1273. <th>Key</th>
  1274. <th>Any Mode</th>
  1275. </tr>
  1276. </thead>
  1277. <tbody>
  1278. <tr>
  1279. <td>Ctrl + Up Arrow</td>
  1280. <td>ESC [ 1 ; 5 A</td>
  1281. </tr>
  1282. <tr>
  1283. <td>Ctrl + Down Arrow</td>
  1284. <td>ESC [ 1 ; 5 B</td>
  1285. </tr>
  1286. <tr>
  1287. <td>Ctrl + Right Arrow</td>
  1288. <td>ESC [ 1 ; 5 C</td>
  1289. </tr>
  1290. <tr>
  1291. <td>Ctrl + Left Arrow</td>
  1292. <td>ESC [ 1 ; 5 D</td>
  1293. </tr>
  1294. </tbody>
  1295. </table>
  1296. <h3 id="numpad--function-keys"><span id="Numpad___Function_Keys__"></span><span id="numpad___function_keys__"></span><span id="NUMPAD___FUNCTION_KEYS__"></span>Numpad &amp; Function Keys</h3>
  1297. <table>
  1298. <thead>
  1299. <tr>
  1300. <th>Key</th>
  1301. <th>Sequence</th>
  1302. </tr>
  1303. </thead>
  1304. <tbody>
  1305. <tr>
  1306. <td>Backspace</td>
  1307. <td>0x7f (DEL)</td>
  1308. </tr>
  1309. <tr>
  1310. <td>Pause</td>
  1311. <td>0x1a (SUB)</td>
  1312. </tr>
  1313. <tr>
  1314. <td>Escape</td>
  1315. <td>0x1b (ESC)</td>
  1316. </tr>
  1317. <tr>
  1318. <td>Insert</td>
  1319. <td>ESC [ 2 ~</td>
  1320. </tr>
  1321. <tr>
  1322. <td>Delete</td>
  1323. <td>ESC [ 3 ~</td>
  1324. </tr>
  1325. <tr>
  1326. <td>Page Up</td>
  1327. <td>ESC [ 5 ~</td>
  1328. </tr>
  1329. <tr>
  1330. <td>Page Down</td>
  1331. <td>ESC [ 6 ~</td>
  1332. </tr>
  1333. <tr>
  1334. <td>F1</td>
  1335. <td>ESC O P</td>
  1336. </tr>
  1337. <tr>
  1338. <td>F2</td>
  1339. <td>ESC O Q</td>
  1340. </tr>
  1341. <tr>
  1342. <td>F3</td>
  1343. <td>ESC O R</td>
  1344. </tr>
  1345. <tr>
  1346. <td>F4</td>
  1347. <td>ESC O S</td>
  1348. </tr>
  1349. <tr>
  1350. <td>F5</td>
  1351. <td>ESC [ 1 5 ~</td>
  1352. </tr>
  1353. <tr>
  1354. <td>F6</td>
  1355. <td>ESC [ 1 7 ~</td>
  1356. </tr>
  1357. <tr>
  1358. <td>F7</td>
  1359. <td>ESC [ 1 8 ~</td>
  1360. </tr>
  1361. <tr>
  1362. <td>F8</td>
  1363. <td>ESC [ 1 9 ~</td>
  1364. </tr>
  1365. <tr>
  1366. <td>F9</td>
  1367. <td>ESC [ 2 0 ~</td>
  1368. </tr>
  1369. <tr>
  1370. <td>F10</td>
  1371. <td>ESC [ 2 1 ~</td>
  1372. </tr>
  1373. <tr>
  1374. <td>F11</td>
  1375. <td>ESC [ 2 3 ~</td>
  1376. </tr>
  1377. <tr>
  1378. <td>F12</td>
  1379. <td>ESC [ 2 4 ~</td>
  1380. </tr>
  1381. </tbody>
  1382. </table>
  1383. <h3 id="modifiers"><span id="Modifiers__"></span><span id="modifiers__"></span><span id="MODIFIERS__"></span>Modifiers</h3>
  1384. <p>Alt is treated by prefixing the sequence with an escape: ESC &lt;c&gt; where &lt;c&gt; is the character passed by the operating system. Alt+Ctrl is handled the same way except that the operating system will have pre-shifted the &lt;c&gt; key to the appropriate control character which will be relayed to the application.</p>
  1385. <p>Ctrl is generally passed through exactly as received from the system. This is typically a single character shifted down into the control character reserved space (0x0-0x1f). For example, Ctrl+@ (0x40) becomes NUL (0x00), Ctrl+[ (0x5b) becomes ESC (0x1b), etc. A few Ctrl key combinations are treated specially according to the following table:</p>
  1386. <table>
  1387. <thead>
  1388. <tr>
  1389. <th>Key</th>
  1390. <th>Sequence</th>
  1391. </tr>
  1392. </thead>
  1393. <tbody>
  1394. <tr>
  1395. <td>Ctrl + Space</td>
  1396. <td>0x00 (NUL)</td>
  1397. </tr>
  1398. <tr>
  1399. <td>Ctrl + Up Arrow</td>
  1400. <td>ESC [ 1 ; 5 A</td>
  1401. </tr>
  1402. <tr>
  1403. <td>Ctrl + Down Arrow</td>
  1404. <td>ESC [ 1 ; 5 B</td>
  1405. </tr>
  1406. <tr>
  1407. <td>Ctrl + Right Arrow</td>
  1408. <td>ESC [ 1 ; 5 C</td>
  1409. </tr>
  1410. <tr>
  1411. <td>Ctrl + Left Arrow</td>
  1412. <td>ESC [ 1 ; 5 D</td>
  1413. </tr>
  1414. </tbody>
  1415. </table>
  1416. <p><strong>Note</strong> Left Ctrl + Right Alt is treated as AltGr. When both are seen together, they will be stripped and the Unicode value of the character presented by the system will be passed into the target. The system will pre-translate AltGr values according to the current system input settings.</p>
  1417. <h2 id="samples"><span id="Samples"></span><span id="samples"></span><span id="SAMPLES"></span>Samples</h2>
  1418. <h3 id="example-of-sgr-terminal-sequences"><span id="example"></span><span id="EXAMPLE"></span>Example of SGR terminal sequences</h3>
  1419. <p>The following code provides several examples of text formatting.</p>
  1420. <pre><code>#include &lt;stdio.h&gt;
  1421. #include &lt;wchar.h&gt;
  1422. #include &lt;windows.h&gt;
  1423. int main()
  1424. {
  1425. // Set output mode to handle virtual terminal sequences
  1426. HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
  1427. if (hOut == INVALID_HANDLE_VALUE)
  1428. {
  1429. return GetLastError();
  1430. }
  1431. DWORD dwMode = 0;
  1432. if (!GetConsoleMode(hOut, &amp;dwMode))
  1433. {
  1434. return GetLastError();
  1435. }
  1436. dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
  1437. if (!SetConsoleMode(hOut, dwMode))
  1438. {
  1439. return GetLastError();
  1440. }
  1441. // Try some Set Graphics Rendition (SGR) terminal escape sequences
  1442. wprintf(L&quot;\x1b[31mThis text has a red foreground using SGR.31.\r\n&quot;);
  1443. wprintf(L&quot;\x1b[1mThis text has a bright (bold) red foreground using SGR.1 to affect the previous color setting.\r\n&quot;);
  1444. wprintf(L&quot;\x1b[mThis text has returned to default colors using SGR.0 implicitly.\r\n&quot;);
  1445. wprintf(L&quot;\x1b[34;46mThis text shows the foreground and background change at the same time.\r\n&quot;);
  1446. wprintf(L&quot;\x1b[0mThis text has returned to default colors using SGR.0 explicitly.\r\n&quot;);
  1447. wprintf(L&quot;\x1b[31;32;33;34;35;36;101;102;103;104;105;106;107mThis text attempts to apply many colors in the same command. Note the colors are applied from left to right so only the right-most option of foreground cyan (SGR.36) and background bright white (SGR.107) is effective.\r\n&quot;);
  1448. wprintf(L&quot;\x1b[39mThis text has restored the foreground color only.\r\n&quot;);
  1449. wprintf(L&quot;\x1b[49mThis text has restored the background color only.\r\n&quot;);
  1450. return 0;
  1451. }
  1452. </code></pre>
  1453. <p><strong>Note</strong> In the previous example, the string '<code>\x1b[31m</code>' is the implementation of <strong>ESC [ &lt;n&gt; m</strong> with &lt;n&gt; being 31.</p>
  1454. <p>The following graphic shows the output of the previous code example.</p>
  1455. <p><img src="images/sgr.png" alt="output of the console using the sgr command" data-linktype="relative-path"/></p>
  1456. <h3 id="example-of-enabling-virtual-terminal-processing"><span id="Example_of_Enabling_Virtual_Terminal_Processing"></span><span id="example_of_enabling_virtual_terminal_processing"></span><span id="EXAMPLE_OF_ENABLING_VIRTUAL_TERMINAL_PROCESSING"></span>Example of Enabling Virtual Terminal Processing</h3>
  1457. <p>The following code provides an example of the recommended way to enable virtual terminal processing for an application. The intent of the sample is to demonstrate:</p>
  1458. <ol>
  1459. <li><p>The existing mode should always be retrieved via GetConsoleMode and analyzed before being set with SetConsoleMode.</p>
  1460. </li>
  1461. <li><p>Checking whether SetConsoleMode returns <code>0</code> and GetLastError returns STATUS_INVALID_PARAMETER is the current mechanism to determine when running on a down-level system. An application receiving STATUS_INVALID_PARAMETER with one of the newer console mode flags in the bit field should gracefully degrade behavior and try again.</p>
  1462. </li>
  1463. </ol>
  1464. <pre><code class="lang-C">#include &lt;stdio.h&gt;
  1465. #include &lt;wchar.h&gt;
  1466. #include &lt;windows.h&gt;
  1467. int main()
  1468. {
  1469. // Set output mode to handle virtual terminal sequences
  1470. HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
  1471. if (hOut == INVALID_HANDLE_VALUE)
  1472. {
  1473. return false;
  1474. }
  1475. HANDLE hIn = GetStdHandle(STD_INPUT_HANDLE);
  1476. if (hIn == INVALID_HANDLE_VALUE)
  1477. {
  1478. return false;
  1479. }
  1480. DWORD dwOriginalOutMode = 0;
  1481. DWORD dwOriginalInMode = 0;
  1482. if (!GetConsoleMode(hOut, &amp;dwOriginalOutMode))
  1483. {
  1484. return false;
  1485. }
  1486. if (!GetConsoleMode(hIn, &amp;dwOriginalInMode))
  1487. {
  1488. return false;
  1489. }
  1490. DWORD dwRequestedOutModes = ENABLE_VIRTUAL_TERMINAL_PROCESSING | DISABLE_NEWLINE_AUTO_RETURN;
  1491. DWORD dwRequestedInModes = ENABLE_VIRTUAL_TERMINAL_INPUT;
  1492. DWORD dwOutMode = dwOriginalOutMode | dwRequestedOutModes;
  1493. if (!SetConsoleMode(hOut, dwOutMode))
  1494. {
  1495. // we failed to set both modes, try to step down mode gracefully.
  1496. dwRequestedOutModes = ENABLE_VIRTUAL_TERMINAL_PROCESSING;
  1497. dwOutMode = dwOriginalOutMode | dwRequestedOutModes;
  1498. if (!SetConsoleMode(hOut, dwOutMode))
  1499. {
  1500. // Failed to set any VT mode, can't do anything here.
  1501. return -1;
  1502. }
  1503. }
  1504. DWORD dwInMode = dwOriginalInMode | ENABLE_VIRTUAL_TERMINAL_INPUT;
  1505. if (!SetConsoleMode(hIn, dwInMode))
  1506. {
  1507. // Failed to set VT input mode, can't do anything here.
  1508. return -1;
  1509. }
  1510. return 0;
  1511. }
  1512. </code></pre>
  1513. <h3 id="example-of-select-anniversary-update-features"><span id="Example_of_Select_Anniversary_Update_Features"></span><span id="example_of_select_anniversary_update_features"></span><span id="EXAMPLE_OF_SELECT_ANNIVERSARY_UPDATE_FEATURES"></span>Example of Select Anniversary Update Features</h3>
  1514. <p>The following example is intended to be a more robust example of code using a variety of escape sequences to manipulate the buffer, with an emphasis on the features added in the Anniversary Update for Windows 10.</p>
  1515. <p>This example makes use of the alternate screen buffer, manipulating tab stops, setting scrolling margins, and changing the character set.</p>
  1516. <pre><code class="lang-C">//
  1517. // Copyright (C) Microsoft. All rights reserved.
  1518. //
  1519. #define DEFINE_CONSOLEV2_PROPERTIES
  1520. // System headers
  1521. #include &lt;windows.h&gt;
  1522. // Standard library C-style
  1523. #include &lt;wchar.h&gt;
  1524. #include &lt;stdlib.h&gt;
  1525. #include &lt;stdio.h&gt;
  1526. #define ESC &quot;\x1b&quot;
  1527. #define CSI &quot;\x1b[&quot;
  1528. bool EnableVTMode()
  1529. {
  1530. // Set output mode to handle virtual terminal sequences
  1531. HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
  1532. if (hOut == INVALID_HANDLE_VALUE)
  1533. {
  1534. return false;
  1535. }
  1536. DWORD dwMode = 0;
  1537. if (!GetConsoleMode(hOut, &amp;dwMode))
  1538. {
  1539. return false;
  1540. }
  1541. dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
  1542. if (!SetConsoleMode(hOut, dwMode))
  1543. {
  1544. return false;
  1545. }
  1546. return true;
  1547. }
  1548. void PrintVerticalBorder()
  1549. {
  1550. printf(ESC &quot;(0&quot;); // Enter Line drawing mode
  1551. printf(CSI &quot;104;93m&quot;); // bright yellow on bright blue
  1552. printf(&quot;x&quot;); // in line drawing mode, \x78 -&gt; \u2502 &quot;Vertical Bar&quot;
  1553. printf(CSI &quot;0m&quot;); // restore color
  1554. printf(ESC &quot;(B&quot;); // exit line drawing mode
  1555. }
  1556. void PrintHorizontalBorder(COORD const Size, bool fIsTop)
  1557. {
  1558. printf(ESC &quot;(0&quot;); // Enter Line drawing mode
  1559. printf(CSI &quot;104;93m&quot;); // Make the border bright yellow on bright blue
  1560. printf(fIsTop? &quot;l&quot; : &quot;m&quot;); // print left corner
  1561. for (int i = 1; i &lt; Size.X - 1; i++)
  1562. printf(&quot;q&quot;); // in line drawing mode, \x71 -&gt; \u2500 &quot;HORIZONTAL SCAN LINE-5&quot;
  1563. printf(fIsTop? &quot;k&quot; : &quot;j&quot;); // print right corner
  1564. printf(CSI &quot;0m&quot;);
  1565. printf(ESC &quot;(B&quot;); // exit line drawing mode
  1566. }
  1567. void PrintStatusLine(char* const pszMessage, COORD const Size)
  1568. {
  1569. printf(CSI &quot;%d;1H&quot;, Size.Y);
  1570. printf(CSI &quot;K&quot;); // clear the line
  1571. printf(pszMessage);
  1572. }
  1573. int __cdecl wmain(int argc, WCHAR* argv[])
  1574. {
  1575. argc; // unused
  1576. argv; // unused
  1577. //First, enable VT mode
  1578. bool fSuccess = EnableVTMode();
  1579. if (!fSuccess)
  1580. {
  1581. printf(&quot;Unable to enter VT processing mode. Quitting.\n&quot;);
  1582. return -1;
  1583. }
  1584. HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
  1585. if (hOut == INVALID_HANDLE_VALUE)
  1586. {
  1587. printf(&quot;Couldn't get the console handle. Quitting.\n&quot;);
  1588. return -1;
  1589. }
  1590. CONSOLE_SCREEN_BUFFER_INFO ScreenBufferInfo;
  1591. GetConsoleScreenBufferInfo(hOut, &amp;ScreenBufferInfo);
  1592. COORD Size;
  1593. Size.X = ScreenBufferInfo.srWindow.Right - ScreenBufferInfo.srWindow.Left + 1;
  1594. Size.Y = ScreenBufferInfo.srWindow.Bottom - ScreenBufferInfo.srWindow.Top + 1;
  1595. // Enter the alternate buffer
  1596. printf(CSI &quot;?1049h&quot;);
  1597. // Clear screen, tab stops, set, stop at columns 16, 32
  1598. printf(CSI &quot;1;1H&quot;);
  1599. printf(CSI &quot;2J&quot;); // Clear screen
  1600. int iNumTabStops = 4; // (0, 20, 40, width)
  1601. printf(CSI &quot;3g&quot;); // clear all tab stops
  1602. printf(CSI &quot;1;20H&quot;); // Move to column 20
  1603. printf(ESC &quot;H&quot;); // set a tab stop
  1604. printf(CSI &quot;1;40H&quot;); // Move to column 40
  1605. printf(ESC &quot;H&quot;); // set a tab stop
  1606. // Set scrolling margins to 3, h-2
  1607. printf(CSI &quot;3;%dr&quot;, Size.Y-2);
  1608. int iNumLines = Size.Y - 4;
  1609. printf(CSI &quot;1;1H&quot;);
  1610. printf(CSI &quot;102;30m&quot;);
  1611. printf(&quot;Windows 10 Anniversary Update - VT Example&quot;);
  1612. printf(CSI &quot;0m&quot;);
  1613. // Print a top border - Yellow
  1614. printf(CSI &quot;2;1H&quot;);
  1615. PrintHorizontalBorder(Size, true);
  1616. // // Print a bottom border
  1617. printf(CSI &quot;%d;1H&quot;, Size.Y-1);
  1618. PrintHorizontalBorder(Size, false);
  1619. wchar_t wch;
  1620. // draw columns
  1621. printf(CSI &quot;3;1H&quot;);
  1622. int line = 0;
  1623. for (line = 0; line &lt; iNumLines * iNumTabStops; line++)
  1624. {
  1625. PrintVerticalBorder();
  1626. if (line + 1 != iNumLines * iNumTabStops) // don't advance to next line if this is the last line
  1627. printf(&quot;\t&quot;); // advance to next tab stop
  1628. }
  1629. PrintStatusLine(&quot;Press any key to see text printed between tab stops.&quot;, Size);
  1630. wch = _getwch();
  1631. // Fill columns with output
  1632. printf(CSI &quot;3;1H&quot;);
  1633. for (line = 0; line &lt; iNumLines; line++)
  1634. {
  1635. int tab = 0;
  1636. for (tab = 0; tab &lt; iNumTabStops-1; tab++)
  1637. {
  1638. PrintVerticalBorder();
  1639. printf(&quot;line=%d&quot;, line);
  1640. printf(&quot;\t&quot;); // advance to next tab stop
  1641. }
  1642. PrintVerticalBorder();// print border at right side
  1643. if (line+1 != iNumLines)
  1644. printf(&quot;\t&quot;); // advance to next tab stop, (on the next line)
  1645. }
  1646. PrintStatusLine(&quot;Press any key to demonstrate scroll margins&quot;, Size);
  1647. wch = _getwch();
  1648. printf(CSI &quot;3;1H&quot;);
  1649. for (line = 0; line &lt; iNumLines * 2; line++)
  1650. {
  1651. printf(CSI &quot;K&quot;); // clear the line
  1652. int tab = 0;
  1653. for (tab = 0; tab &lt; iNumTabStops-1; tab++)
  1654. {
  1655. PrintVerticalBorder();
  1656. printf(&quot;line=%d&quot;, line);
  1657. printf(&quot;\t&quot;); // advance to next tab stop
  1658. }
  1659. PrintVerticalBorder(); // print border at right side
  1660. if (line+1 != iNumLines * 2)
  1661. {
  1662. printf(&quot;\n&quot;); //Advance to next line. If we're at the bottom of the margins, the text will scroll.
  1663. printf(&quot;\r&quot;); //return to first col in buffer
  1664. }
  1665. }
  1666. PrintStatusLine(&quot;Press any key to exit&quot;, Size);
  1667. wch = _getwch();
  1668. // Exit the alternate buffer
  1669. printf(CSI &quot;?1049l&quot;);
  1670. }
  1671. </code></pre>
  1672. <!-- </content> -->
  1673. </main>
  1674. <!-- recommended content page section -->
  1675. <nav data-bi-name="recommendation-bottom" hidden id="recommended-content-center" class="is-hidden-desktop" aria-labelledby="recommended-content-center-title">
  1676. <h3 id="recommended-content-center-title" class="is-size-h2 has-margin-top-large has-margin-bottom-small">Related Articles</h3>
  1677. </nav>
  1678. <!-- end recommended content page section -->
  1679. <!-- page rating section -->
  1680. <div class="is-hidden-desktop has-border-top has-margin-top-large has-padding-top-small">
  1681. <div class="feedback-verbatim has-border-bottom has-padding-bottom-small has-margin-bottom-small" data-bi-name="rating">
  1682. <div class="binary-rating">
  1683. <div class="binary-rating-buttons">
  1684. <h3 class="has-text-weight-semibold has-margin-top-none has-margin-bottom-small">Is this page helpful?</h3>
  1685. <div>
  1686. <button class="thumb-rating like has-inner-focus has-padding-left-extra-small has-padding-right-extra-small" title="Yes" data-bi-name="rating-yes" aria-expanded="false" data-bi-sat="1" aria-controls="rating-container-mobile">
  1687. <span aria-hidden="true" class="icon docon docon-like"></span>
  1688. <span>Yes</span>
  1689. </button>
  1690. <button class="thumb-rating dislike has-inner-focus has-padding-none has-padding-right-extra-small" title="No" data-bi-name="rating-no" data-bi-sat="0" aria-expanded="false" aria-controls="rating-container-mobile">
  1691. <span aria-hidden="true" class="icon docon docon-dislike"></span>
  1692. <span>No</span>
  1693. </button>
  1694. </div>
  1695. </div>
  1696. <form class="feedback-verbatim-form is-hidden" id="rating-container-mobile">
  1697. <div class="verbatim-textarea box is-relative has-box-shadow-none has-border has-margin-top-small has-padding-extra-small is-size-extra-small">
  1698. <label for="rating-textarea-mobile" class="visually-hidden">Any additional feedback?</label>
  1699. <textarea id="rating-textarea-mobile" rows="4" maxlength="999" placeholder="Any additional feedback?" required class="textarea has-border-none has-box-shadow-none has-inner-focus"></textarea>
  1700. </div>
  1701. <div class="buttons is-right has-margin-top-medium has-margin-right-extra-small">
  1702. <button class="skip-rating link-button is-small" type="button">Skip</button>
  1703. <button class="submit-rating button is-primary is-small" data-bi-name="rating-verbatim" disabled type="submit">Submit</button>
  1704. </div>
  1705. </form>
  1706. </div>
  1707. <div class="thankyou-rating is-hidden" tabindex="-1">
  1708. <p>Thank you.</p>
  1709. </div>
  1710. </div> </div>
  1711. <!-- end page rating section -->
  1712. <!-- feedback section -->
  1713. <section class="feedback-section is-relative" data-bi-name="feedback-section">
  1714. <h2 id="feedback" class="is-size-h2 has-margin-top-large">Feedback</h2>
  1715. <div class="alert choose-feedback-type has-margin-top-small has-margin-bottom-none">
  1716. <p aria-hidden="true" id="send-feedback-about" class="has-margin-top-none has-margin-bottom-none">Submit and view feedback for</p>
  1717. <div class="choose-feedback-buttons has-margin-top-large has-margin-bottom-none">
  1718. <a class="button feedback-type-product has-margin-bottom-small" aria-label="Send feedback about this product" href="https://github.com/microsoft/console/issues" data-bi-name="product-feedback">
  1719. <span>This product</span>
  1720. <span aria-hidden="true" class="icon docon docon-navigate-external is-size-h2 has-margin-left-none"></span>
  1721. </a>
  1722. <a class="button feedback-type-product has-margin-bottom-small github-link" aria-label="Send feedback about this page" data-bi-name="create-issue-on-github">
  1723. <span aria-hidden="true" class="docon docon-brand-github has-padding-right-extra-small"></span>
  1724. <span>This page</span>
  1725. </a>
  1726. </div>
  1727. </div>
  1728. <div class="action-container is-flex has-flex-justify-content-end has-margin-top-small has-margin-bottom-small">
  1729. <a class="view-on-github" data-bi-name="view-on-github" href="https://github.com/MicrosoftDocs/Console-Docs/issues">
  1730. <span aria-hidden="true" class="docon docon-brand-github"></span>
  1731. <span>View all page feedback</span>
  1732. <span aria-hidden="true" class="icon docon docon-navigate-external is-size-h5"></span>
  1733. </a>
  1734. </div>
  1735. </section>
  1736. <!-- end feedback section -->
  1737. <!-- feedback report section -->
  1738. <!-- end feedback report section -->
  1739. <div class="footerContainer is-visible-interactive has-default-focus ">
  1740. <footer id="footer-interactive" data-bi-name="footer" class="footer-layout">
  1741. <div class="is-flex is-full-height has-padding-right-extra-large-desktop">
  1742. <a data-mscc-ic="false" class="locale-selector-link has-flex-shrink-none" href="#" data-bi-name="select-locale"><span class="icon docon docon-world is-size-large has-margin-right-small" aria-hidden="true"></span><span class="local-selector-link-text"></span></a>
  1743. <div class="has-margin-left-medium has-margin-right-medium has-flex-shrink-none">
  1744. <div class="dropdown has-caret-up">
  1745. <button class="dropdown-trigger button is-transparent is-small is-icon-only-touch has-inner-focus theme-dropdown-trigger"
  1746. aria-controls="theme-menu-interactive" aria-expanded="false" title="Theme" data-bi-name="theme">
  1747. <span class="icon">
  1748. <span class="docon docon-sun" aria-hidden="true"></span>
  1749. </span>
  1750. <span>Theme</span>
  1751. </button>
  1752. <div class="dropdown-menu" id="theme-menu-interactive" role="menu">
  1753. <ul class="theme-selector has-padding-small">
  1754. <li class="theme is-block">
  1755. <button class="button is-text is-small theme-control is-fullwidth has-flex-justify-content-start"
  1756. data-theme-to="light">
  1757. <span class="theme-light has-margin-right-small">
  1758. <span
  1759. class="theme-selector-icon css-variable-support has-border is-inline-block has-body-background"
  1760. aria-hidden="true">
  1761. <svg class="svg" xmlns="http://www.w3.org/2000/svg"
  1762. viewBox="0 0 22 14">
  1763. <rect width="22" height="14" class="has-fill-body-background" />
  1764. <rect x="5" y="5" width="12" height="4" class="has-fill-secondary" />
  1765. <rect x="5" y="2" width="2" height="1" class="has-fill-secondary" />
  1766. <rect x="8" y="2" width="2" height="1" class="has-fill-secondary" />
  1767. <rect x="11" y="2" width="3" height="1" class="has-fill-secondary" />
  1768. <rect x="1" y="1" width="2" height="2" class="has-fill-secondary" />
  1769. <rect x="5" y="10" width="7" height="2" rx="0.3" class="has-fill-primary" />
  1770. <rect x="19" y="1" width="2" height="2" rx="1" class="has-fill-secondary" />
  1771. </svg>
  1772. </span>
  1773. </span>
  1774. <span role="menuitem">
  1775. Light </span>
  1776. </button>
  1777. </li>
  1778. <li class="theme is-block">
  1779. <button class="button is-text is-small theme-control is-fullwidth has-flex-justify-content-start"
  1780. data-theme-to="dark">
  1781. <span class="theme-dark has-margin-right-small">
  1782. <span
  1783. class="has-border theme-selector-icon css-variable-support is-inline-block has-body-background"
  1784. aria-hidden="true">
  1785. <svg class="svg" xmlns="http://www.w3.org/2000/svg"
  1786. viewBox="0 0 22 14">
  1787. <rect width="22" height="14" class="has-fill-body-background" />
  1788. <rect x="5" y="5" width="12" height="4" class="has-fill-secondary" />
  1789. <rect x="5" y="2" width="2" height="1" class="has-fill-secondary" />
  1790. <rect x="8" y="2" width="2" height="1" class="has-fill-secondary" />
  1791. <rect x="11" y="2" width="3" height="1" class="has-fill-secondary" />
  1792. <rect x="1" y="1" width="2" height="2" class="has-fill-secondary" />
  1793. <rect x="5" y="10" width="7" height="2" rx="0.3" class="has-fill-primary" />
  1794. <rect x="19" y="1" width="2" height="2" rx="1" class="has-fill-secondary" />
  1795. </svg>
  1796. </span>
  1797. </span>
  1798. <span role="menuitem">
  1799. Dark </span>
  1800. </button>
  1801. </li>
  1802. <li class="theme is-block">
  1803. <button class="button is-text is-small theme-control is-fullwidth has-flex-justify-content-start"
  1804. data-theme-to="high-contrast">
  1805. <span class="theme-high-contrast has-margin-right-small">
  1806. <span
  1807. class="has-border theme-selector-icon css-variable-support is-inline-block has-body-background"
  1808. aria-hidden="true">
  1809. <svg class="svg" xmlns="http://www.w3.org/2000/svg"
  1810. viewBox="0 0 22 14">
  1811. <rect width="22" height="14" class="has-fill-body-background" />
  1812. <rect x="5" y="5" width="12" height="4" class="has-fill-secondary" />
  1813. <rect x="5" y="2" width="2" height="1" class="has-fill-secondary" />
  1814. <rect x="8" y="2" width="2" height="1" class="has-fill-secondary" />
  1815. <rect x="11" y="2" width="3" height="1" class="has-fill-secondary" />
  1816. <rect x="1" y="1" width="2" height="2" class="has-fill-secondary" />
  1817. <rect x="5" y="10" width="7" height="2" rx="0.3" class="has-fill-primary" />
  1818. <rect x="19" y="1" width="2" height="2" rx="1" class="has-fill-secondary" />
  1819. </svg>
  1820. </span>
  1821. </span>
  1822. <span role="menuitem">
  1823. High contrast </span>
  1824. </button>
  1825. </li>
  1826. </ul>
  1827. </div>
  1828. </div> </div>
  1829. </div>
  1830. <ul class="links" data-bi-name="footerlinks">
  1831. <li><a data-mscc-ic="false" href="https://docs.microsoft.com/en-us/previous-versions/" data-bi-name="archivelink">Previous Version Docs</a></li>
  1832. <li><a data-mscc-ic="false" href="https://docs.microsoft.com/en-us/teamblog" data-bi-name="bloglink">Blog</a></li>
  1833. <li><a data-mscc-ic="false" href="https://docs.microsoft.com/en-us/contribute" data-bi-name="contributorGuide">Contribute</a></li>
  1834. <li><a data-mscc-ic="false" href="https://go.microsoft.com/fwlink/?LinkId=521839" data-bi-name="privacy">Privacy &amp; Cookies</a></li>
  1835. <li><a data-mscc-ic="false" href="https://docs.microsoft.com/en-us/legal/termsofuse" data-bi-name="termsofuse">Terms of Use</a></li>
  1836. <li><a data-mscc-ic="false" href="https://aka.ms/sitefeedback" data-bi-name="feedback">Site Feedback</a></li>
  1837. <li><a data-mscc-ic="false" href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" data-bi-name="trademarks">Trademarks</a></li>
  1838. <li>&copy; Microsoft 2020</li>
  1839. </ul>
  1840. </footer>
  1841. </div>
  1842. </div>
  1843. <div class="is-size-small right-container column is-one-quarter is-one-fifth-desktop is-hidden-mobile is-hidden-tablet-only" data-bi-name="pageactions" role="complementary" aria-label="Page Actions">
  1844. <div id="affixed-right-container" class="doc-outline is-fixed is-vertically-scrollable">
  1845. <div class="feedback-verbatim has-border-bottom has-padding-bottom-small has-margin-bottom-small" data-bi-name="rating">
  1846. <div class="binary-rating">
  1847. <div class="binary-rating-buttons">
  1848. <h3 class="has-text-weight-semibold has-margin-top-none has-margin-bottom-small">Is this page helpful?</h3>
  1849. <div>
  1850. <button class="thumb-rating like has-inner-focus has-padding-left-extra-small has-padding-right-extra-small" title="Yes" data-bi-name="rating-yes" aria-expanded="false" data-bi-sat="1" aria-controls="rating-container-desktop">
  1851. <span aria-hidden="true" class="icon docon docon-like"></span>
  1852. <span>Yes</span>
  1853. </button>
  1854. <button class="thumb-rating dislike has-inner-focus has-padding-none has-padding-right-extra-small" title="No" data-bi-name="rating-no" data-bi-sat="0" aria-expanded="false" aria-controls="rating-container-desktop">
  1855. <span aria-hidden="true" class="icon docon docon-dislike"></span>
  1856. <span>No</span>
  1857. </button>
  1858. </div>
  1859. </div>
  1860. <form class="feedback-verbatim-form is-hidden" id="rating-container-desktop">
  1861. <div class="verbatim-textarea box is-relative has-box-shadow-none has-border has-margin-top-small has-padding-extra-small is-size-extra-small">
  1862. <label for="rating-textarea-desktop" class="visually-hidden">Any additional feedback?</label>
  1863. <textarea id="rating-textarea-desktop" rows="4" maxlength="999" placeholder="Any additional feedback?" required class="textarea has-border-none has-box-shadow-none has-inner-focus"></textarea>
  1864. </div>
  1865. <div class="buttons is-right has-margin-top-medium has-margin-right-extra-small">
  1866. <button class="skip-rating link-button is-small" type="button">Skip</button>
  1867. <button class="submit-rating button is-primary is-small" data-bi-name="rating-verbatim" disabled type="submit">Submit</button>
  1868. </div>
  1869. </form>
  1870. </div>
  1871. <div class="thankyou-rating is-hidden" tabindex="-1">
  1872. <p>Thank you.</p>
  1873. </div>
  1874. </div> <nav data-bi-name="recommendation-sidebar" hidden id="recommended-content-nav" role="navigation" aria-labelledby="recommended-content-nav-title">
  1875. <h3 id="recommended-content-nav-title">Related Articles</h3>
  1876. </nav>
  1877. <nav id="side-doc-outline" data-bi-name="intopic toc" role="navigation" aria-label="Article Outline">
  1878. <h3>In this article</h3>
  1879. </nav>
  1880. </div>
  1881. </div>
  1882. <!--end of div.columns -->
  1883. </div>
  1884. <!--end of .primary-holder -->
  1885. </section>
  1886. <aside id="interactive-container" class="interactive-container is-visible-interactive column has-body-background-dark ">
  1887. </aside>
  1888. </div>
  1889. <!--end of .mainContainer -->
  1890. </div>
  1891. <div id="openFeedbackContainer" class="openfeedback-container"></div>
  1892. <div class="footerContainer has-default-focus is-hidden-interactive ">
  1893. <footer id="footer" data-bi-name="footer" class="footer-layout uhf-container has-padding" role="contentinfo">
  1894. <div class="is-flex is-full-height has-padding-right-extra-large-desktop">
  1895. <a data-mscc-ic="false" class="locale-selector-link has-flex-shrink-none" href="#" data-bi-name="select-locale"><span class="icon docon docon-world is-size-large has-margin-right-small" aria-hidden="true"></span><span class="local-selector-link-text"></span></a>
  1896. <div class="has-margin-left-medium has-margin-right-medium has-flex-shrink-none">
  1897. <div class="dropdown has-caret-up">
  1898. <button class="dropdown-trigger button is-transparent is-small is-icon-only-touch has-inner-focus theme-dropdown-trigger"
  1899. aria-controls="theme-menu" aria-expanded="false" title="Theme" data-bi-name="theme">
  1900. <span class="icon">
  1901. <span class="docon docon-sun" aria-hidden="true"></span>
  1902. </span>
  1903. <span>Theme</span>
  1904. </button>
  1905. <div class="dropdown-menu" id="theme-menu" role="menu">
  1906. <ul class="theme-selector has-padding-small">
  1907. <li class="theme is-block">
  1908. <button class="button is-text is-small theme-control is-fullwidth has-flex-justify-content-start"
  1909. data-theme-to="light">
  1910. <span class="theme-light has-margin-right-small">
  1911. <span
  1912. class="theme-selector-icon css-variable-support has-border is-inline-block has-body-background"
  1913. aria-hidden="true">
  1914. <svg class="svg" xmlns="http://www.w3.org/2000/svg"
  1915. viewBox="0 0 22 14">
  1916. <rect width="22" height="14" class="has-fill-body-background" />
  1917. <rect x="5" y="5" width="12" height="4" class="has-fill-secondary" />
  1918. <rect x="5" y="2" width="2" height="1" class="has-fill-secondary" />
  1919. <rect x="8" y="2" width="2" height="1" class="has-fill-secondary" />
  1920. <rect x="11" y="2" width="3" height="1" class="has-fill-secondary" />
  1921. <rect x="1" y="1" width="2" height="2" class="has-fill-secondary" />
  1922. <rect x="5" y="10" width="7" height="2" rx="0.3" class="has-fill-primary" />
  1923. <rect x="19" y="1" width="2" height="2" rx="1" class="has-fill-secondary" />
  1924. </svg>
  1925. </span>
  1926. </span>
  1927. <span role="menuitem">
  1928. Light </span>
  1929. </button>
  1930. </li>
  1931. <li class="theme is-block">
  1932. <button class="button is-text is-small theme-control is-fullwidth has-flex-justify-content-start"
  1933. data-theme-to="dark">
  1934. <span class="theme-dark has-margin-right-small">
  1935. <span
  1936. class="has-border theme-selector-icon css-variable-support is-inline-block has-body-background"
  1937. aria-hidden="true">
  1938. <svg class="svg" xmlns="http://www.w3.org/2000/svg"
  1939. viewBox="0 0 22 14">
  1940. <rect width="22" height="14" class="has-fill-body-background" />
  1941. <rect x="5" y="5" width="12" height="4" class="has-fill-secondary" />
  1942. <rect x="5" y="2" width="2" height="1" class="has-fill-secondary" />
  1943. <rect x="8" y="2" width="2" height="1" class="has-fill-secondary" />
  1944. <rect x="11" y="2" width="3" height="1" class="has-fill-secondary" />
  1945. <rect x="1" y="1" width="2" height="2" class="has-fill-secondary" />
  1946. <rect x="5" y="10" width="7" height="2" rx="0.3" class="has-fill-primary" />
  1947. <rect x="19" y="1" width="2" height="2" rx="1" class="has-fill-secondary" />
  1948. </svg>
  1949. </span>
  1950. </span>
  1951. <span role="menuitem">
  1952. Dark </span>
  1953. </button>
  1954. </li>
  1955. <li class="theme is-block">
  1956. <button class="button is-text is-small theme-control is-fullwidth has-flex-justify-content-start"
  1957. data-theme-to="high-contrast">
  1958. <span class="theme-high-contrast has-margin-right-small">
  1959. <span
  1960. class="has-border theme-selector-icon css-variable-support is-inline-block has-body-background"
  1961. aria-hidden="true">
  1962. <svg class="svg" xmlns="http://www.w3.org/2000/svg"
  1963. viewBox="0 0 22 14">
  1964. <rect width="22" height="14" class="has-fill-body-background" />
  1965. <rect x="5" y="5" width="12" height="4" class="has-fill-secondary" />
  1966. <rect x="5" y="2" width="2" height="1" class="has-fill-secondary" />
  1967. <rect x="8" y="2" width="2" height="1" class="has-fill-secondary" />
  1968. <rect x="11" y="2" width="3" height="1" class="has-fill-secondary" />
  1969. <rect x="1" y="1" width="2" height="2" class="has-fill-secondary" />
  1970. <rect x="5" y="10" width="7" height="2" rx="0.3" class="has-fill-primary" />
  1971. <rect x="19" y="1" width="2" height="2" rx="1" class="has-fill-secondary" />
  1972. </svg>
  1973. </span>
  1974. </span>
  1975. <span role="menuitem">
  1976. High contrast </span>
  1977. </button>
  1978. </li>
  1979. </ul>
  1980. </div>
  1981. </div> </div>
  1982. </div>
  1983. <ul class="links" data-bi-name="footerlinks">
  1984. <li><a data-mscc-ic="false" href="https://docs.microsoft.com/en-us/previous-versions/" data-bi-name="archivelink">Previous Version Docs</a></li>
  1985. <li><a data-mscc-ic="false" href="https://docs.microsoft.com/en-us/teamblog" data-bi-name="bloglink">Blog</a></li>
  1986. <li><a data-mscc-ic="false" href="https://docs.microsoft.com/en-us/contribute" data-bi-name="contributorGuide">Contribute</a></li>
  1987. <li><a data-mscc-ic="false" href="https://go.microsoft.com/fwlink/?LinkId=521839" data-bi-name="privacy">Privacy &amp; Cookies</a></li>
  1988. <li><a data-mscc-ic="false" href="https://docs.microsoft.com/en-us/legal/termsofuse" data-bi-name="termsofuse">Terms of Use</a></li>
  1989. <li><a data-mscc-ic="false" href="https://aka.ms/sitefeedback" data-bi-name="feedback">Site Feedback</a></li>
  1990. <li><a data-mscc-ic="false" href="https://www.microsoft.com/en-us/legal/intellectualproperty/Trademarks/EN-US.aspx" data-bi-name="trademarks">Trademarks</a></li>
  1991. <li>&copy; Microsoft 2020</li>
  1992. </ul>
  1993. </footer>
  1994. </div>
  1995. <div id="action-panel" role="region" aria-label="Action Panel" class="action-panel has-default-focus" tabindex="-1"></div>
  1996. <span id="adobe-target-experiment-container" hidden></span>
  1997. </body>
  1998. </html>