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

Open
opened 2026-01-31 07:42:10 +00:00 by claunia · 0 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:10 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21354