<ul dir="auto">
<li>Your Windows build number:  (Type <code class="notranslate">ver</code> at a Windows Command Prompt)</li>
</ul>
<p dir="auto">Microsoft Windows [Version 10.0.17763.292]</p>
<ul dir="auto">
<li>What you're doing and what's happening: (Copy &amp; paste specific commands and their output, or include screen shots)</li>
</ul>
<p dir="auto">When using the new ConPTY feature it seems there is some behind the scenes optimisation happening surrounding colours that is assuming colour state. For example when using the default background/foreground escape sequences ([49m/[39m), they are either getting removed or changed into a reset sequence ([m), this make it difficult to write a frontend to ConPTY that wants to for example have a window background colour that isn't one of the colours specified by the escape sequences. (i.e. where [m and [49m would do different things).</p>
<p dir="auto">And example of this is at <a href="https://github.com/brads55/conpty-testcase">https://github.com/brads55/conpty-testcase</a> (based on the EchoCon sample), where the following can be seen:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/8070284/51805191-5766b900-2262-11e9-95a9-ef6268d29990.png"><img src="https://user-images.githubusercontent.com/8070284/51805191-5766b900-2262-11e9-95a9-ef6268d29990.png" alt="testcase" style="max-width: 100%;"></a></p>
<p dir="auto">I also suspect this is the cause of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="372725082" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/293" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/293/hovercard" href="https://github.com/microsoft/terminal/issues/293">#293</a>.</p>
<ul dir="auto">
<li>What's wrong / what should be happening instead:</li>
</ul>
<p dir="auto">It would be great if either these optimisations didn't happen or there was at least a way of disabling them in order to get the real raw escape sequences.</p>
<p dir="auto">bash repro: <code class="notranslate">echo -e '\x1b[40mabc'</code><br>
powershell repro: <code class="notranslate">Write-Host -BackgroundColor Black "Hello"</code></p>
<p dir="auto">Expected (conhost/powershell.exe):</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/2193314/47322816-4593cb00-d60e-11e8-868e-3eed3f982faf.png"><img src="https://user-images.githubusercontent.com/2193314/47322816-4593cb00-d60e-11e8-868e-3eed3f982faf.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Actual (vscode/conpty):</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/2193314/47322787-21d08500-d60e-11e8-8245-7ba4a1c0e8b3.png"><img src="https://user-images.githubusercontent.com/2193314/47322787-21d08500-d60e-11e8-8245-7ba4a1c0e8b3.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/2193314/47322839-547a7d80-d60e-11e8-99ab-e25df61c19cf.png"><img src="https://user-images.githubusercontent.com/2193314/47322839-547a7d80-d60e-11e8-99ab-e25df61c19cf.png" alt="image" style="max-width: 100%;"></a></p>