Copying text still includes white space instead of newlines #4111

Closed
opened 2026-01-30 23:38:23 +00:00 by claunia · 2 comments
Owner

Originally created by @moritzuehling on GitHub (Sep 27, 2019).

Originally assigned to: @carlos-zamora on GitHub.

Hi everyone,

I thought this was addressed in #2797, but it didn't. It might be a duplicate of #174.

The problem

In short, copying + pasting is very weird with newlines. In some cases, it seems to copy only some of them:

image

But using clear in the WSL seems to reliably and effectively completely break copying.
image

It doesn't copy any whitespaces, instead, it copies the buffer as-is.

The same effect seems to occur with PowerShell. Here without a clear beforehand:
image

And here with a clear beforehand:
image

System info

The selected console is a standard WSL Ubuntu, as detected by the terminal:

    {
      "guid": "{2c4de342-38b7-51cf-b940-2309a097f518}",
      "hidden": false,
      "name": "Ubuntu",
      "source": "Windows.Terminal.Wsl"
    }

If it's a powershell, it's similar:

    {
      // Make changes here to the powershell.exe profile
      "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
      "name": "Windows PowerShell",
      "commandline": "powershell.exe",
      "hidden": false
    },

Nothing in the config has been changed, besides adding two (unrelated) profiles. In the screenshot, the Windows Terminal was freshly opened.

Version information of Windows Terminal:

Windows Terminal (Preview)
Version: 0.5.2681.0

System + Build Info:
image

If I can help with providing anything else, please do ask.

Originally created by @moritzuehling on GitHub (Sep 27, 2019). Originally assigned to: @carlos-zamora on GitHub. Hi everyone, I thought this was addressed in #2797, but it didn't. It might be a duplicate of #174. The problem --- In short, copying + pasting is very weird with newlines. In some cases, it seems to copy only *some* of them: ![image](https://user-images.githubusercontent.com/7847742/65805801-55555100-e187-11e9-9216-89556dfeaad7.png) But using `clear` in the WSL seems to reliably and effectively completely break copying. ![image](https://user-images.githubusercontent.com/7847742/65806217-cf3a0a00-e188-11e9-84ba-5ee17b1ceaae.png) It doesn't copy any whitespaces, instead, it copies the buffer as-is. The same effect seems to occur with PowerShell. Here without a `clear` beforehand: ![image](https://user-images.githubusercontent.com/7847742/65806287-1e803a80-e189-11e9-9c2c-c335a3e34def.png) And here with a clear beforehand: ![image](https://user-images.githubusercontent.com/7847742/65806308-2e981a00-e189-11e9-8b07-c0a0c198180d.png) System info --- The selected console is a standard WSL Ubuntu, as detected by the terminal: ```js { "guid": "{2c4de342-38b7-51cf-b940-2309a097f518}", "hidden": false, "name": "Ubuntu", "source": "Windows.Terminal.Wsl" } ``` If it's a powershell, it's similar: ```js { // Make changes here to the powershell.exe profile "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "name": "Windows PowerShell", "commandline": "powershell.exe", "hidden": false }, ``` Nothing in the config has been changed, besides adding two (unrelated) profiles. In the screenshot, the Windows Terminal was freshly opened. Version information of Windows Terminal: ``` Windows Terminal (Preview) Version: 0.5.2681.0 ``` System + Build Info: ![image](https://user-images.githubusercontent.com/7847742/65805934-d3195c80-e187-11e9-9f7a-2b9b07fe42c7.png) If I can help with providing anything else, please do ask.
claunia added the Issue-BugNeeds-Tag-FixProduct-TerminalArea-TerminalControl labels 2026-01-30 23:38:24 +00:00
Author
Owner

@moritzuehling commented on GitHub (Sep 28, 2019):

Since I wanted to be a bit proactive, here is a small workaround I've written: https://github.com/moritzuehling/WindowsTerminalClipboardFixup

@moritzuehling commented on GitHub (Sep 28, 2019): Since I wanted to be a bit proactive, here is a small workaround I've written: https://github.com/moritzuehling/WindowsTerminalClipboardFixup
Author
Owner

@moritzuehling commented on GitHub (Nov 29, 2019):

Seems to be fixed in the newest version, closing! Thank you for fixing it ♥

@moritzuehling commented on GitHub (Nov 29, 2019): Seems to be fixed in the newest version, closing! Thank you for fixing it ♥
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#4111