<h1 dir="auto">Environment</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: 10.0.18362.0
Windows Terminal version (if applicable): 0.6.2951.0"><pre lang="none" class="notranslate"><code class="notranslate">Windows build number: 10.0.18362.0
Windows Terminal version (if applicable): 0.6.2951.0
</code></pre></div>
<h1 dir="auto">Epic</h1>
<p dir="auto">Scrollback handling should be just like in VTE because that's the best (ahem ahem) <g-emoji class="g-emoji" alias="rofl" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f923.png">🤣</g-emoji></p>
<h1 dir="auto">Steps to reproduce 1</h1>
<ul dir="auto">
<li>
<p dir="auto"><code class="notranslate">ssh</code> to a Linux box, and execute these:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="seq -f 'normal %.f' 100
echo -ne '\e[?1049h' # switch to alt screen
seq -f 'alt %.f' 100
echo -ne '\e[?1049l' # switch back to normal screen"><pre class="notranslate"><code class="notranslate">seq -f 'normal %.f' 100
echo -ne '\e[?1049h' # switch to alt screen
seq -f 'alt %.f' 100
echo -ne '\e[?1049l' # switch back to normal screen
</code></pre></div>
</li>
<li>
<p dir="auto">scroll back and examine the contents</p>
</li>
</ul>
<h1 dir="auto">Expected behavior 1</h1>
<p dir="auto">Outputs of these two <code class="notranslate">seq</code>s shouldn't interleave</p>
<h1 dir="auto">Actual behavior 1</h1>
<p dir="auto">Output consists of <code class="notranslate">normal 1</code> to <code class="notranslate">normal 74</code> (exact number depends on the window height), followed by <code class="notranslate">alt 1</code> to <code class="notranslate">alt 74</code>, and finally <code class="notranslate">normal 75</code> to <code class="notranslate">normal 100</code>. (<code class="notranslate">alt 75</code> onwards are gone.)</p>
<h1 dir="auto">Steps to reproduce 2</h1>
<ul dir="auto">
<li><code class="notranslate">ssh</code> to a Linux box.</li>
<li>produce a few pages of output</li>
<li>start a fullscreen app such as <code class="notranslate">mc</code></li>
<li>resize the window in various ways (maybe even back and forth to smaller and then bigger)</li>
<li>quit <code class="notranslate">mc</code></li>
<li>examine the output, including the scrollback</li>
</ul>
<h1 dir="auto">Expected behavior 2</h1>
<p dir="auto">This should look okay (see below).</p>
<h1 dir="auto">Actual behavior 2</h1>
<p dir="auto">The contents seem quite garbled. Most of the time you'll see remains of <code class="notranslate">mc</code>'s user interface in the scrollback buffer; sometimes even on the normal screen (this latter is harder to reproduce, and perhaps only happens with solid background colors).</p>
<hr>
<h1 dir="auto">VTE rocks</h1>
<p dir="auto">The way this works amazingly in gnome-terminal is:</p>
<p dir="auto">The alternate screen is pretty much only used by fullscreen apps that control the entire UI and repaint on window resize. Therefore it's unrelated to the normal screen and the scrollback. Data never travels between the (normal screen + scrollback) combo and the alternate screen. The scrollback buffer belongs to the normal screen only. Everything scrolled out from the alternate screen is lost for good.</p>
<p dir="auto">On resize, the (normal screen + scrollback) is resized as a single unit, for the resizing operation it doesn't matter where the boundary is.</p>
<p dir="auto">The (normal screen + scrollback) combo is resized the same way, regardless of whether it's the active one or the alternate screen is shown. Stress-test this: produce output on the normal screen, switch to the alternate one (e.g. <code class="notranslate">mc</code>), resize, quit <code class="notranslate">mc</code>. The normal screen's contents will be updated to the new width just as if you haven't switched to the alternate screen.</p>
<p dir="auto">There's plenty of further tiny details to this story, e.g. how to vertically position the contents, some of which are documented in <a href="https://gitlab.gnome.org/GNOME/vte/blob/master/doc/rewrap.txt" rel="nofollow">VTE's doc/rewrap.txt</a>.</p>
<p dir="auto">Of course there's no specification anywhere that all this has to behave like this. It's just what I believe makes the most sense. Obviously my opinion is quite biased since this was my first big contribution to VTE. :) Luckily I only had to do the rewrapping; the separation of the (normal screen + scrollback) vs. alternate screen was already as desired.</p>
<h1 dir="auto">Environment</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: Microsoft Windows [Version 10.0.18362.295]
Windows Terminal version :  0.4.2382.0
Input method: the system defaut microsoft pinyin input method."><pre lang="none" class="notranslate"><code class="notranslate">Windows build number: Microsoft Windows [Version 10.0.18362.295]
Windows Terminal version :  0.4.2382.0
Input method: the system defaut microsoft pinyin input method.
</code></pre></div>
<h1 dir="auto">Steps to reproduce</h1>

<p dir="auto">always.</p>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">the input method can switch to chinese mode, and can type chinese characters.</p>

<h1 dir="auto">Actual behavior</h1>
<p dir="auto">the input method  is always in english mode, and cannot type chinese characters .</p>