Pasting from clipboard strips line endings #5344

Open
opened 2026-01-31 00:11:07 +00:00 by claunia · 0 comments
Owner

Originally created by @wdolek on GitHub (Dec 2, 2019).

When pasting text from terminal, text I'm copying does not contain correct line endings - I simply get single line of content. I tried with WSL, Git Bash and PowerShell.

I have found plenty of issues related to copy-pasting - either closed as resolved (but this issue is still present) or not related to missing line ends (rather adding more line ends).

Environment


Platform ServicePack Version      VersionString
-------- ----------- -------      -------------
Win32NT             10.0.18363.0 Microsoft Windows NT 10.0.18363.0
Windows Terminal (Preview)
Version: 0.7.3291.0

Steps to reproduce

  1. Having profiles:
        {
            "guid": "{00000000-0000-0000-0000-000000000001}",
            "name" : "Bash",
            "commandline" : "\"%PROGRAMFILES%\\git\\usr\\bin\\bash.exe\" -i -l",
            "hidden": false,
            "acrylicOpacity": 0.8,
            "fontFace": "Fira Code",
            "fontSize": 10,
            "padding": "4, 4, 4, 4",
            "useAcrylic": true,
            "closeOnExit" : true,
            "icon" : "%PROGRAMFILES%\\Git\\mingw64\\share\\git\\git-for-windows.ico",
            "startingDirectory" : "%USERPROFILE%"
        },
        {
            "guid": "{2c4de342-38b7-51cf-b940-2309a097f518}",
            "hidden": false,
            "name": "Ubuntu",
            "source": "Windows.Terminal.Wsl",
            "acrylicOpacity": 0.8,
            "fontFace": "Fira Code",
            "fontSize": 10,
            "padding": "4, 4, 4, 4",
            "useAcrylic": true
        },
        {
            "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
            "name": "Windows PowerShell",
            "commandline": "powershell.exe",
            "hidden": false,
            "fontFace": "Fira Code",
            "fontSize": 10,
            "padding": "4, 4, 4, 4"
        },
  1. ... and keybindings:
    "keybindings": [
        { "command": "copy", "keys": ["ctrl+insert"] },
        { "command": "paste", "keys": ["shift+insert"] }
    ]
  1. Open either WSL, Git Bash or PS terminal
  2. Run:
    Git Bash/WSL: curl -v -X GET https://www.example.com/
    PS: (curl -v http://www.example.com/).RawContent
  3. Select output, copy to clipboard (Ctrl+Insert)
  4. Open notepad.exe / code / sublime / ... (text editor of your choice)
  5. Paste from clipboard (Shift+Insert)

Expected behavior

Text copied from clipboard is well formatted, line endings respected:

curl -v -X GET https://www.example.com/
Note: Unnecessary use of -X or --request, GET is already inferred.
*
Trying 93.184.216.34...
* Connected to www.example.com (93.184.216.34) port 443 (#0)
* found 148 certificates in /etc/ssl/certs/ca-certificates.crt
* found 592 certificates in /etc/ssl/certs
* ...
> GET / HTTP/1.1
> Host: www.example.com
> User-Agent: curl/7.47.0
> yada yada yada request headers
>
< HTTP/1.1 200 OK
< yada yada yada response headers
<
<!doctype html>
...

Actual behavior

Single line pasted:

curl -v -X GET https://www.example.com/                                                                                                                                                             Note: Unnecessary use of -X or --request, GET is already inferred.                                                                                                                                                                           *   Trying 93.184.216.34...                                                                                                                                                                                                                  > GET / HTTP/1.1                                                                                                                                                                                                                             > Host: www.example.com                                                                                                                                                                                                                      > User-Agent: curl/7.47.0                                                                                                                                                                                                                    > Accept: */*                                                                                                                                                                                                                                >                                                                                                                                                                                                                                            < HTTP/1.1 200 OK                                                                                                                                                                                                                            <!doctype html>.
Originally created by @wdolek on GitHub (Dec 2, 2019). When pasting text *from* terminal, text I'm copying does not contain correct line endings - I simply get single line of content. I tried with WSL, Git Bash and PowerShell. I have found plenty of issues related to copy-pasting - either closed as resolved (but this issue is still present) or not related to missing line ends (rather adding more line ends). # Environment ```none Platform ServicePack Version VersionString -------- ----------- ------- ------------- Win32NT 10.0.18363.0 Microsoft Windows NT 10.0.18363.0 ``` ```none Windows Terminal (Preview) Version: 0.7.3291.0 ``` # Steps to reproduce 1. Having profiles: ```json { "guid": "{00000000-0000-0000-0000-000000000001}", "name" : "Bash", "commandline" : "\"%PROGRAMFILES%\\git\\usr\\bin\\bash.exe\" -i -l", "hidden": false, "acrylicOpacity": 0.8, "fontFace": "Fira Code", "fontSize": 10, "padding": "4, 4, 4, 4", "useAcrylic": true, "closeOnExit" : true, "icon" : "%PROGRAMFILES%\\Git\\mingw64\\share\\git\\git-for-windows.ico", "startingDirectory" : "%USERPROFILE%" }, { "guid": "{2c4de342-38b7-51cf-b940-2309a097f518}", "hidden": false, "name": "Ubuntu", "source": "Windows.Terminal.Wsl", "acrylicOpacity": 0.8, "fontFace": "Fira Code", "fontSize": 10, "padding": "4, 4, 4, 4", "useAcrylic": true }, { "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "name": "Windows PowerShell", "commandline": "powershell.exe", "hidden": false, "fontFace": "Fira Code", "fontSize": 10, "padding": "4, 4, 4, 4" }, ``` 2. ... and keybindings: ```json "keybindings": [ { "command": "copy", "keys": ["ctrl+insert"] }, { "command": "paste", "keys": ["shift+insert"] } ] ``` 3. Open either WSL, Git Bash or PS terminal 4. Run: Git Bash/WSL: `curl -v -X GET https://www.example.com/` PS: `(curl -v http://www.example.com/).RawContent` 5. Select output, copy to clipboard (`Ctrl+Insert`) 6. Open notepad.exe / code / sublime / ... (text editor of your choice) 7. Paste from clipboard (`Shift+Insert`) # Expected behavior Text copied from clipboard is well formatted, line endings respected: ```none curl -v -X GET https://www.example.com/ Note: Unnecessary use of -X or --request, GET is already inferred. * Trying 93.184.216.34... * Connected to www.example.com (93.184.216.34) port 443 (#0) * found 148 certificates in /etc/ssl/certs/ca-certificates.crt * found 592 certificates in /etc/ssl/certs * ... > GET / HTTP/1.1 > Host: www.example.com > User-Agent: curl/7.47.0 > yada yada yada request headers > < HTTP/1.1 200 OK < yada yada yada response headers < <!doctype html> ... ``` # Actual behavior Single line pasted: ```none curl -v -X GET https://www.example.com/ Note: Unnecessary use of -X or --request, GET is already inferred. * Trying 93.184.216.34... > GET / HTTP/1.1 > Host: www.example.com > User-Agent: curl/7.47.0 > Accept: */* > < HTTP/1.1 200 OK <!doctype html>. ```
claunia added the Needs-Tag-Fix label 2026-01-31 00:11:07 +00:00
Sign in to join this conversation.
No Label Needs-Tag-Fix
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#5344