<h1 dir="auto">Environment</h1>
<p dir="auto">Windows build number: Version 10.0.18362.356</p>
<h1 dir="auto">Steps to reproduce</h1>
<p dir="auto">Open a WSL shell in conhost and execute the following command:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="printf &quot;\ec\e[1;15r\e[3g\e[1;20H\eH\e[?25l\e[9;20H\e[?1049hstart\r\e[99Bmargin\e[H\ttab\n&quot;"><pre class="notranslate"><code class="notranslate">printf "\ec\e[1;15r\e[3g\e[1;20H\eH\e[?25l\e[9;20H\e[?1049hstart\r\e[99Bmargin\e[H\ttab\n"
</code></pre></div>
<p dir="auto">This initialises a number of terminal properties.</p>
<ul dir="auto">
<li>The scrolling margins are set to 1:15 (<code class="notranslate">DECSTBM</code>).</li>
<li>The tabstops are cleared and then a single tabstop is set at column 20 (<code class="notranslate">TBC</code>/<code class="notranslate">HTS</code>).</li>
<li>The cursor blinking is disabled (<code class="notranslate">DECTCEM</code>).</li>
<li>The cursor position is set to line 9 column 20 (<code class="notranslate">CUP</code>).</li>
</ul>
<p dir="auto">It then switches to the alternate screen buffer (private mode 1049) and "tests" the state.</p>
<ul dir="auto">
<li>The text "start" is output to indicate the starting position.</li>
<li>The cursor is moved down 99 lines (<code class="notranslate">CUD</code>), and the text "margin" is output to indicate the bottom margin position.</li>
<li>The cursor is moved to the home position (<code class="notranslate">CUP</code>) and a tab is output, followed by the text "tab" to indicate the position of the tab stop.</li>
</ul>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">I would expect all of the initial state to be inherited by the alt buffer, producing the following results:</p>
<ul dir="auto">
<li>The "start" text should be on line 9, column 20, i.e. the position before the switch to the alt buffer.</li>
<li>The "margin" text should be on line 15, the bottom margin.</li>
<li>The "tab" text should be in column 20, the position of the tab stop that was set.</li>
<li>The cursor should be invisible.</li>
</ul>
<p dir="auto">Here's what the output looks like in XTerm:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/4181424/68713559-08da9f00-0596-11ea-8b6b-576c75d74042.png"><img src="https://user-images.githubusercontent.com/4181424/68713559-08da9f00-0596-11ea-8b6b-576c75d74042.png" alt="image" style="max-width: 100%;"></a></p>
<h1 dir="auto">Actual behavior</h1>
<p dir="auto">When switching to the alt buffer in conhost, we reset all those properties, producing the following results:</p>
<ul dir="auto">
<li>The "start" text is in the top left corner.</li>
<li>The "margin" text is at the bottom of the screen.</li>
<li>The "tab" text is in column 9.</li>
<li>The cursor is visible.</li>
</ul>
<p dir="auto">Here's what our output looks like:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/4181424/68713572-1132da00-0596-11ea-952a-59f732829014.png"><img src="https://user-images.githubusercontent.com/4181424/68713572-1132da00-0596-11ea-952a-59f732829014.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">The reason for this behaviour is because these properties are part of the <code class="notranslate">SCREEN_INFORMATION</code> class, and the alternate buffer is implemented as a separate instance of that class, when it should really be sharing much of that state with the main buffer.</p>
<p dir="auto">The scroll margins are a little more complicated, since those properties are also duplicated in the <code class="notranslate">AdaptDispatch</code> class. And this can result in some weirdness when switching to the alt buffer since the two sets of values can end up out of sync.</p>
<h1 dir="auto">Environment</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Microsoft Windows [Version 10.0.18362.295]
Any other software? No"><pre lang="none" class="notranslate"><code class="notranslate">Microsoft Windows [Version 10.0.18362.295]
Any other software? No
</code></pre></div>
<h1 dir="auto">Steps to reproduce</h1>

<p dir="auto">Install the application from Windows Store (or from binaries released on this repo) and launch it, it results in the following error:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/13923364/63764494-526ff380-c89d-11e9-8679-dfb8ffc2d608.png"><img src="https://user-images.githubusercontent.com/13923364/63764494-526ff380-c89d-11e9-8679-dfb8ffc2d608.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Builds made on my machine launches just fine, so I don't know how I can get more info to debug this issue (they crash after using it for a while, but I don't think this is related to the same bug).</p>
<h1 dir="auto">Expected behavior</h1>

<p dir="auto">The application installed from the store should launch just like the ones built on my machine.</p>
<h1 dir="auto">Actual behavior</h1>

<p dir="auto">It crashes, with the error <code class="notranslate">File system error (12029).</code></p>