<p dir="auto">Hi everyone,</p>
<p dir="auto">I thought this was addressed in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="494868673" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/2797" data-hovercard-type="pull_request" data-hovercard-url="/microsoft/terminal/pull/2797/hovercard" href="https://github.com/microsoft/terminal/pull/2797">#2797</a>, but it didn't. It might be a duplicate of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="322014163" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/174" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/174/hovercard" href="https://github.com/microsoft/terminal/issues/174">#174</a>.</p>
<h2 dir="auto">The problem</h2>
<p dir="auto">In short, copying + pasting is very weird with newlines. In some cases, it seems to copy only <em>some</em> of them:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/7847742/65805801-55555100-e187-11e9-9216-89556dfeaad7.png"><img src="https://user-images.githubusercontent.com/7847742/65805801-55555100-e187-11e9-9216-89556dfeaad7.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">But using <code class="notranslate">clear</code> in the WSL seems to reliably and effectively completely break copying.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/7847742/65806217-cf3a0a00-e188-11e9-84ba-5ee17b1ceaae.png"><img src="https://user-images.githubusercontent.com/7847742/65806217-cf3a0a00-e188-11e9-84ba-5ee17b1ceaae.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">It doesn't copy any whitespaces, instead, it copies the buffer as-is.</p>
<p dir="auto">The same effect seems to occur with PowerShell. Here without a <code class="notranslate">clear</code> beforehand:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/7847742/65806287-1e803a80-e189-11e9-9c2c-c335a3e34def.png"><img src="https://user-images.githubusercontent.com/7847742/65806287-1e803a80-e189-11e9-9c2c-c335a3e34def.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">And here with a clear beforehand:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/7847742/65806308-2e981a00-e189-11e9-8b07-c0a0c198180d.png"><img src="https://user-images.githubusercontent.com/7847742/65806308-2e981a00-e189-11e9-8b07-c0a0c198180d.png" alt="image" style="max-width: 100%;"></a></p>
<h2 dir="auto">System info</h2>
<p dir="auto">The selected console is a standard WSL Ubuntu, as detected by the terminal:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    {
      &quot;guid&quot;: &quot;{2c4de342-38b7-51cf-b940-2309a097f518}&quot;,
      &quot;hidden&quot;: false,
      &quot;name&quot;: &quot;Ubuntu&quot;,
      &quot;source&quot;: &quot;Windows.Terminal.Wsl&quot;
    }"><pre class="notranslate">    <span class="pl-kos">{</span>
      <span class="pl-s">"guid"</span>: <span class="pl-s">"{2c4de342-38b7-51cf-b940-2309a097f518}"</span><span class="pl-kos">,</span>
      <span class="pl-s">"hidden"</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
      <span class="pl-s">"name"</span>: <span class="pl-s">"Ubuntu"</span><span class="pl-kos">,</span>
      <span class="pl-s">"source"</span>: <span class="pl-s">"Windows.Terminal.Wsl"</span>
    <span class="pl-kos">}</span></pre></div>
<p dir="auto">If it's a powershell, it's similar:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    {
      // Make changes here to the powershell.exe profile
      &quot;guid&quot;: &quot;{61c54bbd-c2c6-5271-96e7-009a87ff44bf}&quot;,
      &quot;name&quot;: &quot;Windows PowerShell&quot;,
      &quot;commandline&quot;: &quot;powershell.exe&quot;,
      &quot;hidden&quot;: false
    },"><pre class="notranslate">    <span class="pl-kos">{</span>
      <span class="pl-c">// Make changes here to the powershell.exe profile</span>
      <span class="pl-s">"guid"</span>: <span class="pl-s">"{61c54bbd-c2c6-5271-96e7-009a87ff44bf}"</span><span class="pl-kos">,</span>
      <span class="pl-s">"name"</span>: <span class="pl-s">"Windows PowerShell"</span><span class="pl-kos">,</span>
      <span class="pl-s">"commandline"</span>: <span class="pl-s">"powershell.exe"</span><span class="pl-kos">,</span>
      <span class="pl-s">"hidden"</span>: <span class="pl-c1">false</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span></pre></div>
<p dir="auto">Nothing in the config has been changed, besides adding two (unrelated) profiles. In the screenshot, the Windows Terminal was freshly opened.</p>
<p dir="auto">Version information of Windows Terminal:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows Terminal (Preview)
Version: 0.5.2681.0"><pre class="notranslate"><code class="notranslate">Windows Terminal (Preview)
Version: 0.5.2681.0
</code></pre></div>
<p dir="auto">System + Build Info:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/7847742/65805934-d3195c80-e187-11e9-9f7a-2b9b07fe42c7.png"><img src="https://user-images.githubusercontent.com/7847742/65805934-d3195c80-e187-11e9-9f7a-2b9b07fe42c7.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">If I can help with providing anything else, please do ask.</p>
<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.18363.476
Windows Terminal version (if applicable): 0.6.2951.0

Any other software?"><pre lang="none" class="notranslate"><code class="notranslate">Windows build number: 10.0.18363.476
Windows Terminal version (if applicable): 0.6.2951.0

Any other software?
</code></pre></div>
<h1 dir="auto">Steps to reproduce</h1>

<ul dir="auto">
<li>Open cmd</li>
<li>Type any chars until line breaks</li>
<li>Type <code class="notranslate">Backspace</code> until the cursor gets back to the previous row</li>
</ul>
<h1 dir="auto">Expected behavior</h1>

<p dir="auto">Every <code class="notranslate">Backspace</code> should delete one char</p>
<h1 dir="auto">Actual behavior</h1>

<p dir="auto">When cursor changes line there is one additional space to delete and the typing position is off by one afterward.<br>
PS seems to work correctly<br>
Deleting chars with <code class="notranslate">Del</code> seems to work correctly</p>