{"id":4095,"date":"2018-12-10T10:00:23","date_gmt":"2018-12-10T18:00:23","guid":{"rendered":"http:\/\/blogs.msdn.microsoft.com\/commandline\/?p=4095"},"modified":"2019-02-25T16:54:29","modified_gmt":"2019-02-26T00:54:29","slug":"new-experimental-console-features","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/commandline\/new-experimental-console-features\/","title":{"rendered":"New Experimental Console Features"},"content":{"rendered":"<p>As of <a href=\"https:\/\/blogs.windows.com\/windowsexperience\/2018\/12\/10\/announcing-windows-10-insider-preview-build-18298\">Windows 10 build 18298<\/a>, when you open the properties page of any Console window, you\u2019ll notice an additional \u201cTerminal\u201d tab. Click on this tab and you\u2019ll see several new settings for some experimental features we\u2019re working on for future OS releases:<\/p>\n<p><figure id=\"attachment_4115\" aria-labelledby=\"figcaption_attachment_4115\" class=\"wp-caption alignnone\" ><img decoding=\"async\" width=\"600\" height=\"335\" class=\"size-medium wp-image-4115\" alt=\"Experimental settings in action\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-settings-600x335.png\" \/><figcaption id=\"figcaption_attachment_4115\" class=\"wp-caption-text\">]<a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-settings.png\">2<\/a> Experimental settings in action<\/figcaption><\/figure><\/p>\n<blockquote>\n<p><strong>Important Note<\/strong>: These settings are &#8220;experimental&#8221;, because in certain scenarios, it&#8217;s possible that they might not behave like you would expect them to, may not make it into the next OS release, and may change completely before we ship! But have fun with them anyway and let us know how you get on \u2013 we\u2019d love to hear your feedback. Let\u2019s outline each of the settings groups from the bottom up, ending with a more thorough discussion the Terminal Color settings:<\/p>\n<\/blockquote>\n<h2>Terminal Scrolling<\/h2>\n<h3>Disable Scroll Forward:<\/h3>\n<ul>\n<li>When cleared (default state), the Console can to scroll anywhere within the Console\u2019s buffer, even below the most recent row of text displayed When checked, the Console will not allow scrolling below the last line output, similar to how most *NIX terminals work<\/li>\n<\/ul>\n<h2>Cursor Shape<\/h2>\n<p><strong>Legacy Style<\/strong>: Thicker underscore by default, but controlled by the cursor size property in the &#8220;Options&#8221; page<\/p>\n<p><span style=\"float: none;background-color: #ffffff;color: #333333;cursor: text;font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size: 16px;font-style: normal;font-variant: normal;font-weight: 400;letter-spacing: normal;text-align: left;text-decoration: none;text-indent: 0px\"><\/span><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-cursor-default.png\"><img decoding=\"async\" width=\"600\" height=\"158\" class=\"alignnone size-medium wp-image-4145\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-cursor-default-600x158.png\" \/><\/a><\/p>\n<p><span><strong>Underscore<\/strong>: Thinner underscore<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-cursor-underscore.png\"><img decoding=\"async\" width=\"600\" height=\"156\" class=\"alignnone size-medium wp-image-4165\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-cursor-underscore-600x156.png\" \/><\/a><\/p>\n<p><strong>Vertical Bar<\/strong>: For all you crazy kids who like your cursors tall and skinny<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-cursor-vertical.png\"><img decoding=\"async\" width=\"600\" height=\"183\" class=\"alignnone size-medium wp-image-4175\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-cursor-vertical-600x183.png\" \/><\/a><\/p>\n<p><strong>Empty Box<\/strong>: The second-best cursor:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-cursor-box.png\"><img decoding=\"async\" width=\"600\" height=\"172\" class=\"alignnone size-medium wp-image-4135\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-cursor-box-600x172.png\" \/><\/a><\/p>\n<p><strong>Solid Box<\/strong>: The one true cursor<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-cursor-filled.png\"><img decoding=\"async\" width=\"600\" height=\"167\" class=\"alignnone size-medium wp-image-4155\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-cursor-filled-600x167.png\" \/><\/a><\/p>\n<h2>Cursor Colors<\/h2>\n<p><strong>Inverse Color<\/strong>: The current and default behavior where the cursor color is the calculated inverse of the background color \u2026 which results in, for example, this adorable fetching pink against the bright green background of my first computer \u2013 the <a target=\"_blank\" href=\"https:\/\/en.wikipedia.org\/wiki\/Dragon_32\/64\" rel=\"noopener\">Dragon 32<\/a> \ud83d\ude0a <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-cursor-color-inverse.png\"><img decoding=\"async\" width=\"600\" height=\"166\" class=\"alignnone size-medium wp-image-4195\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-cursor-color-inverse-600x166.png\" \/><\/a><\/p>\n<p>\u00a0<\/p>\n<p><strong>Use Color<\/strong>: Draw the cursor in a specific RGB color, like this fetching green against dark gray background: <a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-cursor-color.png\"><img decoding=\"async\" width=\"600\" height=\"169\" class=\"alignnone size-medium wp-image-4185\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-cursor-color-600x169.png\" \/><\/a><\/p>\n<p>\u00a0<\/p>\n<h2>Terminal Colors<\/h2>\n<p>The Terminal Colors fields allow you to specify specific RGB color values for the default foreground and\/or background colors. These colors are independent of the color palette and are not affected by changes you make to your color palette! But before we discuss the inherent implications here, we need to consider how these new settings fit into the color changes we\u2019ve been making over the last several Windows 10 releases:<\/p>\n<h3>Karma Karma Karma Karma Console Chameleon<\/h3>\n<p>Over the last couple of years, during \u201cThe Grand Overhaul\u201d of Windows Console, we\u2019ve made some significant improvements to Console\u2019s parsing and handling of ANSI\/VT sequences, and how the Console stores and renders colored text.<\/p>\n<p>This all started with a rewrite of the Console\u2019s VT parser. Prior to the (then new) team\u2019s efforts, Windows Console barely supported any VT sequences at all. But with the steady growth in adoption of *NIX-first open-source tools, many of which emit VT sequences to color and draw text-based UI\u2019s, it was increasingly imperative that the Windows Console be able to support VT sequences.<\/p>\n<p><figure id=\"attachment_4205\" aria-labelledby=\"figcaption_attachment_4205\" class=\"wp-caption alignnone\" ><img decoding=\"async\" width=\"600\" height=\"347\" class=\"size-medium wp-image-4205\" alt=\"Before (XP) and after (Win10) VT support added to Console\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-VT-before-after1-600x347.png\" \/><figcaption id=\"figcaption_attachment_4205\" class=\"wp-caption-text\">]<a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-VT-before-after1.png\">10<\/a> Before (XP) and after (Win10) VT support added to Console<\/figcaption><\/figure><\/p>\n<p>This was made even more important and urgent due to the arrival of Windows Subsystem for Linux which allowed unmodified Linux binaries to run natively on Windows, allowing Windows users to easily run most of the *NIX tools they\u2019d previously had to fire-up in a separate VM.<\/p>\n<p>The first significant version of the Console\u2019s new VT engine shipped in Windows 10 1609 (Anniversary Update), and was quickly followed in the 1703 (Creators Update) release which contained much richer support for a wider range of VT sequences. This allowed Console to render many of even the most complex text-based UI\u2019s generated by tools like <a href=\"https:\/\/github.com\/tmux\/tmux\">Tmux<\/a> (a <a href=\"https:\/\/www.hamvocke.com\/blog\/a-quick-and-easy-guide-to-tmux\/\">great tutorial here<\/a> for the uninitiated) and <a href=\"https:\/\/midnight-commander.org\/\">Midnight Commander<\/a> \u2026 or even <code>vim<\/code>, <code>bash<\/code>, <code>Midnight Commander<\/code> and <code>htop<\/code> running simultaneously in separate <code>Tmux<\/code> panes:<\/p>\n<p><figure id=\"attachment_4215\" aria-labelledby=\"figcaption_attachment_4215\" class=\"wp-caption alignnone\" ><img decoding=\"async\" width=\"600\" height=\"400\" class=\"size-medium wp-image-4215\" alt=\"TMux hosting vim, bash, Midnight Commander, and htop\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-tmux-600x400.png\" \/><figcaption id=\"figcaption_attachment_4215\" class=\"wp-caption-text\">]<a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-tmux.png\">14<\/a> TMux hosting vim, bash, Midnight Commander, and htop<\/figcaption><\/figure><\/p>\n<p>Also in Creators Update, <a href=\"https:\/\/devblogs.microsoft.com\/commandline\/24-bit-color-in-the-windows-console\/\">the Console shipped its massively improved color support<\/a>, increasing its color support from a mere 8-bit\/16-colors (a single 8-bit value held both the foreground and background color 0-7 in the low and high nybble respectively), to full 24-bit\/16M-colors!<\/p>\n<p>But we weren\u2019t yet done! In the Fall Creators Update (Oct 2017), we <a href=\"https:\/\/blogs.msdn.microsoft.com\/commandline\/2017\/08\/02\/updating-the-windows-console-colors\/\">updated the Console\u2019s default color palette<\/a> for the first time \u2026 <strong><em>ever<\/em><\/strong>! After working with Microsoft\u2019s usability and accessibility teams, and following recommended color selection guidelines, we arrived at a new color palette that is FAR better suited to modern high-contrast displays.<\/p>\n<p>In addition, we also shipped an <a href=\"https:\/\/blogs.msdn.microsoft.com\/commandline\/2017\/08\/11\/introducing-the-windows-console-colortool\/\">open-source ColorTool<\/a> which you can use to apply different color palette\u2019s to your Console windows if you wish.<\/p>\n<p>So, we\u2019re done with color support in the Console, right?<\/p>\n<p><strong><em>Nope!<\/em><\/strong><\/p>\n<h2>Looking Back, Moving Forward<\/h2>\n<p>The Console now lives in two worlds:<\/p>\n<ol>\n<li>1&#46; Windows \u2013 Console supports traditional\/legacy command-line Windows apps that call the <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/console\/console-functions\">Win32 Console APIs<\/a> to color\/manipulate text displayed on the Console<\/li>\n<li>ANSI\/VT \u2013 Console also now supports apps that color\/manipulate the text that they display by embedding VT sequences within the text that they emit<\/li>\n<\/ol>\n<p>Because of #2 above, Console has to support some of the different ways in which VT compatible terminals think about the world.<\/p>\n<p>A key difference between Windows Console and *NIX-based VT Terminals is that *NIX Terminals have a notion of default foreground and background colors, which are independent from the Terminal\u2019s color palette. The Windows Console does not \u2026 at least not quite the same!<\/p>\n<p>Windows Console refers the \u201cScreen Text\u201d and \u201cScreen Background\u201d colors to the colors defined in the Console\u2019s palette:<\/p>\n<p><figure id=\"attachment_4235\" aria-labelledby=\"figcaption_attachment_4235\" class=\"wp-caption alignnone\" ><img decoding=\"async\" width=\"600\" height=\"393\" class=\"size-medium wp-image-4235\" alt=\"Console color settings\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-standard-color-settings-600x393.png\" \/><figcaption id=\"figcaption_attachment_4235\" class=\"wp-caption-text\">]<a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-standard-color-settings.png\">19<\/a> Console color settings<\/figcaption><\/figure><\/p>\n<p>\u00a0<\/p>\n<p>But Console has no notion of \u201cdefault\u201d foreground or background color to the command-line apps that draw on the screen. At best, there\u2019s an assumption that color #0 is often the background color, and that #7 is the foreground, but this is an often-incorrect assumption, not a widely-understood rule. In fact, Windows command-line apps have no way of determining the default foreground and background colors!!<\/p>\n<p>For a good example of this, let\u2019s explore Windows PowerShell: The Windows PowerShell team wanted to differentiate PowerShell Consoles from Cmd Consoles by changing the PowerShell Console\u2019s default background color.<\/p>\n<p>They specifically modified the PowerShell shortcuts\u2019 settings:<\/p>\n<ul>\n<li>Re-defined color #5 as a specific shade of blue: RGB(1,36,86)<\/li>\n<li>Re-defined color #6 as a specific shade of gray: RGB(238,237,240)<\/li>\n<\/ul>\n<p>However, they also decided to modify the shortcut\u2019s background and foreground color indexes to<\/p>\n<ul>\n<li>Color #5 as the background color (instead of the generally assumed color #0)<\/li>\n<li>Color #6 as the foreground color (instead of the generally assumed color #7)<\/li>\n<\/ul>\n<p>Sometimes, PowerShell wants to, for example, \u201crender this text in <color> on whatever the default background color is\u201d.<\/color><\/p>\n<p>Alas, because Windows Console has no API to discover what the \u201cdefault background color\u201d is, PowerShell assumes that the background is the color defined by color #0 \u2026 which usually IS the background color \u2026 except in PowerShell which uses color #5<\/p>\n<p>Thus, if you\u2019ve ever mis-typed a command in Windows PowerShell, you\u2019ve likely seen something like this:<\/p>\n<p><figure id=\"attachment_4245\" aria-labelledby=\"figcaption_attachment_4245\" class=\"wp-caption alignnone\" ><img decoding=\"async\" width=\"600\" height=\"377\" class=\"size-medium wp-image-4245\" alt=\"PowerShell assumes the background color is #0\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-PowerShell-600x377.png\" \/><figcaption id=\"figcaption_attachment_4245\" class=\"wp-caption-text\">]<a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/33\/2019\/02\/Experimental-PowerShell.png\">20<\/a> PowerShell assumes the background color is #0<\/figcaption><\/figure><\/p>\n<h2>Moving Forward<\/h2>\n<p>Alas, the changes we\u2019re working on (and exposing via the experimental Terminal settings page) won\u2019t fix this specific issue for Windows PowerShell \u2639<\/p>\n<p>Existing\/legacy applications that specifically say \u201c<em>draw this text in <some -foreground-color> on color #0<\/some><\/em>\u201d will still draw text in some-foreground-color, on a (usually black\/dark) background, even if the Console\u2019s default background color is bright green! In some ways this is good;there will be no behavioral change for existing\/legacy apps. But the downside is that such apps will continue to render less than optimal output (like in the PowerShell example above.<\/p>\n<p>However, making Console aware of the notion of \u201cdefault independent foreground and background colors\u201d will enable Console to more accurately render VT enriched text-UI, and will give Console users more control over the customizability of their Command-Line environment.<\/p>\n<h2>Call To Action!<\/h2>\n<p>This issue further amplifies the recommendation to <strong>start writing (or update existing) Command-Line apps to emit VT enriched text, rather than calling Win32 Console APIs to control\/format Console output<\/strong>: VT-enabled apps will not only benefit from rendering improvements like those described above (with more on the way), but they\u2019ll also enjoy richer features available via VT-sequences, like 24-bit color support, and default foreground\/background color support.<\/p>\n<p>\u00a0<\/p>\n<p>We look forward to hearing how you get-on with these experimental changes. If you find issues with the color support, please <a href=\"https:\/\/github.com\/microsoft\/console\">find\/file issues on our GitHub issues repo<\/a>, reach out and let <a href=\"https:\/\/twitter.com\/richturn_ms\">@richturn_ms know on Twitter<\/a>, and\/or submit feedback via the Feedback Hub.<\/p>\n<p>\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As of Windows 10 build 18298, when you open the properties page of any Console window, you\u2019ll notice an additional \u201cTerminal\u201d tab. Click on this tab and you\u2019ll see several new settings for some experimental features we\u2019re working on for future OS releases: Important Note: These settings are &#8220;experimental&#8221;, because in certain scenarios, it&#8217;s possible [&hellip;]<\/p>\n","protected":false},"author":910,"featured_media":4164,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[10,2,3,6,9],"tags":[19,27,28,42,48],"class_list":["post-4095","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cmd","category-command-line","category-linux-tools","category-windows-console","category-bash-on-ubuntu-on-windows","tag-ansivt-sequences","tag-cmd","tag-color","tag-linux","tag-powershell"],"acf":[],"blog_post_summary":"<p>As of Windows 10 build 18298, when you open the properties page of any Console window, you\u2019ll notice an additional \u201cTerminal\u201d tab. Click on this tab and you\u2019ll see several new settings for some experimental features we\u2019re working on for future OS releases: Important Note: These settings are &#8220;experimental&#8221;, because in certain scenarios, it&#8217;s possible [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/posts\/4095","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/users\/910"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/comments?post=4095"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/posts\/4095\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/media\/4164"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/media?parent=4095"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/categories?post=4095"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/tags?post=4095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}