Pasting a single line with newline at end doesn't paste newline #21359

Closed
opened 2026-01-31 07:42:18 +00:00 by claunia · 5 comments
Owner

Originally created by @d3x0r on GitHub (Mar 6, 2024).

Windows Terminal version

1.18.10301.0

Windows build number

Version 10.0.22631.3155

Other Software

Far Manager (running in terminal, especially the edit file mode), or EFTE (another text editor running in terminal)

Steps to reproduce

Copy a line of text, usually done by going to the start of the line, holding shift, and using the down arrow, to include all text on the line including the line ending.
Got to another line, and paste. The line is only inserted before the new line, and the line ending is not pasted. If multiple lines are copied, the line endings are inserted, and the new lines are inserted before the line the cursor is currently positioned before.

The line that is copied does retain the end of line indicator, if I paste it into an external application like notepad++, the line ending is included and inserts the line as a new line before the current line. While terminal is just inserting the text of the line on the same line, without moving the current line down after the pasted line.

Test file
Line 1
Line 2
Line 3

Say you copy 'Line 1' by going to the start of the line, holding shift and using down arrow. would look something like this, with the cursor at the start of 'Line 2' (which the image does not show):
image

then go to 'Line 2' and paste.

This is what terminal is doing

Test file
Line 1
Line 1Line 2
Line 3

This is what I would expect.

Test file
Line 1
Line 1
Line 2
Line 3

Expected Behavior

I would expect a complete line which includes a newline to paste including the newline.

Actual Behavior

Inserts only the text up to the end of line indicator.

This is important, since I am being forced to use Microsoft Terminal instead of legacy terminal because I use WSL, and I can't, on a per-application basis, select a specific mode for each application. I had to disable a halfdozen keys like alt-tab in terminal in order to allow FAR to use alt-tab and various extended motions like ctrl-pageup/pagedn. This itself is inconvenient, because I can't disable shortcuts on a per-application basis... so now I can't even move between tabs, if wanted to use this as a tabbed terminal; I'd rather just use legacy console for some applications and terminal for others.

It's really quite a bother to change the mode to terminal, start a WSL prompt, and then change the mode back to legacy console so I can use a console that works.

Also Pasting text is VERY slow, like 300 baud slow. You can visibly see the characters being entered one at a time, instead of the whole block just working.

Originally created by @d3x0r on GitHub (Mar 6, 2024). ### Windows Terminal version 1.18.10301.0 ### Windows build number Version 10.0.22631.3155 ### Other Software Far Manager (running in terminal, especially the edit file mode), or EFTE (another text editor running in terminal) ### Steps to reproduce Copy a line of text, usually done by going to the start of the line, holding shift, and using the down arrow, to include all text on the line including the line ending. Got to another line, and paste. The line is only inserted before the new line, and the line ending is not pasted. If multiple lines are copied, the line endings are inserted, and the new lines are inserted before the line the cursor is currently positioned before. The line that is copied does retain the end of line indicator, if I paste it into an external application like notepad++, the line ending is included and inserts the line as a new line before the current line. While terminal is just inserting the text of the line on the same line, without moving the current line down after the pasted line. ``` Test file Line 1 Line 2 Line 3 ``` Say you copy 'Line 1' by going to the start of the line, holding shift and using down arrow. would look something like this, with the cursor at the start of 'Line 2' (which the image does not show): ![image](https://github.com/microsoft/terminal/assets/1909610/1cc33ce2-e664-4e1a-8b25-00e6f3e258cc) then go to 'Line 2' and paste. This is what terminal is doing ``` Test file Line 1 Line 1Line 2 Line 3 ``` This is what I would expect. ``` Test file Line 1 Line 1 Line 2 Line 3 ``` ### Expected Behavior I would expect a complete line which includes a newline to paste including the newline. ### Actual Behavior Inserts only the text up to the end of line indicator. This is important, since I am being forced to use Microsoft Terminal instead of legacy terminal because I use WSL, and I can't, on a per-application basis, select a specific mode for each application. I had to disable a halfdozen keys like alt-tab in terminal in order to allow FAR to use alt-tab and various extended motions like ctrl-pageup/pagedn. This itself is inconvenient, because I can't disable shortcuts on a per-application basis... so now I can't even move between tabs, if wanted to use this as a tabbed terminal; I'd rather just use legacy console for some applications and terminal for others. It's really quite a bother to change the mode to terminal, start a WSL prompt, and then change the mode back to legacy console so I can use a console that works. Also Pasting text is VERY slow, like 300 baud slow. You can visibly see the characters being entered one at a time, instead of the whole block just working.
claunia added the Needs-TriageIssue-Bug labels 2026-01-31 07:42:18 +00:00
Author
Owner

@github-actions[bot] commented on GitHub (Mar 6, 2024):

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@github-actions[bot] commented on GitHub (Mar 6, 2024): Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you! ### Closed similar issues: - [Pasting multiple lines doesn't execute the last line (#12387)](https://github.com/microsoft/terminal/issues/12387), similarity score: 0.82 - [copy paste with multiple lines doesnt skip spaces and insert new line at the end of each line (#2839)](https://github.com/microsoft/terminal/issues/2839), similarity score: 0.82 - [Option to paste without the final newline (#12185)](https://github.com/microsoft/terminal/issues/12185), similarity score: 0.81 - [Paste without warning about newline (#10720)](https://github.com/microsoft/terminal/issues/10720), similarity score: 0.81 - [Wraped output contains new line character when copy/paste (#12889)](https://github.com/microsoft/terminal/issues/12889), similarity score: 0.78 > Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Author
Owner

@DHowett commented on GitHub (Mar 6, 2024):

FWIW, while we work on triaging this issue...

WSL fortunately does not require Terminal. It requires the "modern console". You are not forced to choose between the legacy console and Terminal; rather, you can still use the console host that has come with (and continues to come with) Windows 10 and 11 for the past handful of years.

Instead of turning on legacy console mode:

conhost_2noLQj64M5

you can just set a different default console application host:

image

@DHowett commented on GitHub (Mar 6, 2024): FWIW, while we work on triaging this issue... WSL fortunately does not require Terminal. It requires the "modern console". You are not forced to choose between the legacy console and Terminal; rather, you can still use the console host that has come with (and continues to come with) Windows 10 and 11 for the past handful of years. Instead of turning on legacy console mode: <img width="287" alt="conhost_2noLQj64M5" src="https://github.com/microsoft/terminal/assets/189190/eb7ee09d-da6a-4ed1-b862-4c145e0546b2"> you can just set a different default console application host: ![image](https://github.com/microsoft/terminal/assets/189190/0af840fa-13ad-40bb-9899-37b1a5adabd5)
Author
Owner

@DHowett commented on GitHub (Mar 6, 2024):

It looks like you're running with whitespace stripping enabled. You can turn it off in the Interaction settings. We can evaluate making that a per-profile setting.

image

alt-tab

Unfortunately, Terminal is not in control of alt-tab. That key is reserved by the desktop environment. If it conflicts with FAR manager... I suspect that alt-tab has existed in Windows far longer than FAR manager has. ☹️

I'd rather just use legacy console for some applications and terminal for others.

If you switch to the "Windows Console Host" as described above, you can choose when to use Terminal (by launching it directly).

@DHowett commented on GitHub (Mar 6, 2024): It looks like you're running with whitespace stripping enabled. You can turn it off in the Interaction settings. We can evaluate making that a per-profile setting. <img width="424" alt="image" src="https://github.com/microsoft/terminal/assets/189190/860168fb-e959-4c1b-9c04-8b17535c985e"> > <kbd>alt-tab</kbd> Unfortunately, Terminal is not in control of alt-tab. That key is reserved by the desktop environment. If it conflicts with FAR manager... I suspect that alt-tab has existed in Windows far longer than FAR manager has. ☹️ > I'd rather just use legacy console for some applications and terminal for others. If you switch to the "Windows Console Host" as described above, you can choose when to use Terminal (by launching it directly).
Author
Owner

@d3x0r commented on GitHub (Mar 6, 2024):

@DHowett Ahh yes changing that setting resolves my problem
and yes I can use conhost without legacy and use wsl too. I didn't see the other setting in the console properties, and I swear the same sort of setting in windows terminal settings behaved like the legacy setting too, but apparently today it doesn't.

@d3x0r commented on GitHub (Mar 6, 2024): @DHowett Ahh yes changing that setting resolves my problem and yes I can use conhost without legacy and use wsl too. I didn't see the other setting in the console properties, and I swear the same sort of setting in windows terminal settings behaved like the legacy setting too, but apparently today it doesn't.
Author
Owner

@DHowett commented on GitHub (Mar 7, 2024):

Thanks for circling back!

As for your other concerns:

We have a couple issues in the repo tracking general I/O performance and specifically clipboard input performance. It's an area we're actively investing in.

One of the things we've been discussing is an operating mode that's closer to the console that doesn't sacrifice too many Terminal features. In the long term, we're not intending to force everyone over to Terminal and leave the console host behind, but I do want to close the gap so it's an easier decision for people to make. 🙂

@DHowett commented on GitHub (Mar 7, 2024): Thanks for circling back! As for your other concerns: We have a couple issues in the repo tracking general I/O performance and specifically clipboard input performance. It's an area we're actively investing in. One of the things we've been discussing is an operating mode that's closer to the console that doesn't sacrifice too many Terminal features. In the long term, we're not intending to force everyone over to Terminal and leave the console host behind, but I do want to close the gap so it's an easier _decision_ for people to make. 🙂
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21359