WSL Ubuntu, cannot copy-paste correctly in nano or vim editor #1724

Closed
opened 2026-01-30 22:34:43 +00:00 by claunia · 3 comments
Owner

Originally created by @nntantidakis on GitHub (Jun 17, 2019).

Environment

Windows build number: Microsoft Windows [Version 10.0.18362.175]
Windows Terminal version (if applicable):0.0.1.0

Steps to reproduce

Login to WSL, use nano to edit a file, mark a text that has at least a linebreak, and paste it on another line. For example in my local Deb Mirror, i mark this
image

Expected behavior

The expectet behavior like wsl command line, would be to paste the text exactly as copied with right click on the selected one, with all line-breaks
image

Actual behavior

The actual behavior is that it copies it without preserving any linebreak and tries to do it in one line
image
image
image

Originally created by @nntantidakis on GitHub (Jun 17, 2019). <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment Windows build number: Microsoft Windows [Version 10.0.18362.175] Windows Terminal version (if applicable):0.0.1.0 # Steps to reproduce Login to WSL, use nano to edit a file, mark a text that has at least a linebreak, and paste it on another line. For example in my local Deb Mirror, i mark this ![image](https://user-images.githubusercontent.com/37312505/59615267-e3528200-912a-11e9-9422-cfe4ee58acb8.png) <!-- A description of how to trigger this bug. --> # Expected behavior The expectet behavior like wsl command line, would be to paste the text exactly as copied with right click on the selected one, with all line-breaks ![image](https://user-images.githubusercontent.com/37312505/59616899-016db180-912e-11e9-9e0d-124975392fef.png) # Actual behavior The actual behavior is that it copies it without preserving any linebreak and tries to do it in one line ![image](https://user-images.githubusercontent.com/37312505/59615381-109f3000-912b-11e9-82d2-4d2a74045d22.png) ![image](https://user-images.githubusercontent.com/37312505/59615416-1c8af200-912b-11e9-8282-e54d4fd87a71.png) ![image](https://user-images.githubusercontent.com/37312505/59615433-26acf080-912b-11e9-9872-57847fdea5d4.png)
claunia added the Needs-TriageNeeds-Tag-FixResolution-Duplicate labels 2026-01-30 22:34:43 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Jun 18, 2019):

@carlos-zamora might have thoughts here.

IIRC you can copy without trailing whitespace by holding shift when you right click.

There's also a lot of discussion on handling copy/paste behavior in various threads. I believe #1091 is the megathread for that.

@zadjii-msft commented on GitHub (Jun 18, 2019): @carlos-zamora might have thoughts here. IIRC you can copy without trailing whitespace by holding shift when you right click. There's also a _lot_ of discussion on handling copy/paste behavior in various threads. I believe #1091 is the megathread for that.
Author
Owner

@nntantidakis commented on GitHub (Jun 18, 2019):

Judging by the thread name you mentioned, this megathread is referred to pasting a text, this bug is referred while copying it. I forgot to mention that if you select and rightclick the text(copy) and paste it on notepad, it has the exactly same result. So its not a paste problem
image

However if i copy a clean text from original wsl bash.exe, and paste it another problem occurs, it duplicates the breaklines, and thats what the thread #1091 says, but i think its another problem from what i specified, however not sure if they are related
image

Note: Copying while holding shift does not have any impact

@nntantidakis commented on GitHub (Jun 18, 2019): Judging by the thread name you mentioned, this megathread is referred to pasting a text, this bug is referred while copying it. I forgot to mention that if you select and rightclick the text(copy) and paste it on notepad, it has the exactly same result. So its not a paste problem ![image](https://user-images.githubusercontent.com/37312505/59697446-7f958b00-91f6-11e9-9f3a-5edf74f501ea.png) However if i copy a clean text from original wsl bash.exe, and paste it another problem occurs, it duplicates the breaklines, and thats what the thread #1091 says, but i think its another problem from what i specified, however not sure if they are related ![image](https://user-images.githubusercontent.com/37312505/59697532-a5229480-91f6-11e9-904c-f2f49b75b150.png) Note: Copying while holding shift does not have any impact
Author
Owner

@DHowett-MSFT commented on GitHub (Jun 18, 2019):

This looks like a dupe of both #1073 #1091.

@DHowett-MSFT commented on GitHub (Jun 18, 2019): This looks like a dupe of both #1073 #1091.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1724