Whitespace characters added to start of each line when pasting text #9793

Closed
opened 2026-01-31 02:03:54 +00:00 by claunia · 3 comments
Owner

Originally created by @atifraza on GitHub (Jul 23, 2020).

Environment

Windows build number: 19041.388
Windows Terminal version: 1.1.2021.0 (applicable to version too 1.0.1811.0)

Any other software?
WSL2 running Ubuntu 20.04

Steps to reproduce

Copy a multiline text file using

  • cat config | clip.exe

or

  • cat config followed by selection with mouse and right-click or Ctrl+Shift+C

Open nano and paste the text using

  • Right-click

or

  • By pressing Ctrl+Shift+V

Expected behavior

Text is pasted as displayed by cat, without any whitespace characters at the start of individual lines

Sample of displayed text:
InkedScreenshot 2020-07-23 16 20 38_LI

Actual behavior

Multi-line text which does not have whitespaces at the start of new lines is pasted correctly.
Multi-line text with some indented lines is not pasted correctly, whitespaces start getting appended at the start of each line after the first occurrence of a whitespace character.

Sample of how text gets pasted:
InkedScreenshot 2020-07-23 16 38 17_LI

Originally created by @atifraza on GitHub (Jul 23, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- 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. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: 19041.388 Windows Terminal version: 1.1.2021.0 (applicable to version too 1.0.1811.0) Any other software? WSL2 running Ubuntu 20.04 ``` # Steps to reproduce Copy a multiline text file using - `cat config | clip.exe` or - `cat config` followed by selection with mouse and right-click or `Ctrl+Shift+C` Open nano and paste the text using - Right-click or - By pressing `Ctrl+Shift+V` <!-- A description of how to trigger this bug. --> # Expected behavior Text is pasted as displayed by `cat`, without any whitespace characters at the start of individual lines Sample of displayed text: ![InkedScreenshot 2020-07-23 16 20 38_LI](https://user-images.githubusercontent.com/24366479/88299424-9f08bc80-cd02-11ea-8269-b92ea63a9bb6.jpg) <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> # Actual behavior Multi-line text which does not have whitespaces at the start of new lines is pasted correctly. Multi-line text with some indented lines is not pasted correctly, whitespaces start getting appended at the start of each line after the first occurrence of a whitespace character. Sample of how text gets pasted: ![InkedScreenshot 2020-07-23 16 38 17_LI](https://user-images.githubusercontent.com/24366479/88299901-2ce4a780-cd03-11ea-9db2-63c719ca2a46.jpg) <!-- What's actually happening? -->
claunia added the Resolution-Duplicate label 2026-01-31 02:03:54 +00:00
Author
Owner

@DHowett commented on GitHub (Jul 23, 2020):

Your text editor is in autoindent mode, but the pasted text contains literal whitespace.

If I’m reading between the lines, this is a request for bracketed paste mode (so nano knows when to ignore the leading whitespace)

/dup #395

@DHowett commented on GitHub (Jul 23, 2020): Your text editor is in autoindent mode, but the pasted text contains literal whitespace. If I’m reading between the lines, this is a request for bracketed paste mode (so nano knows when to ignore the leading whitespace) /dup #395
Author
Owner

@ghost commented on GitHub (Jul 23, 2020):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Jul 23, 2020): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Author
Owner

@atifraza commented on GitHub (Jul 23, 2020):

Your text editor is in autoindent mode, but the pasted text contains literal whitespace.

If I’m reading between the lines, this is a request for bracketed paste mode (so nano knows when to ignore the leading whitespace)

/dup #395

Exactly, I did have autoindent enabled for nano. Disabling it allows to paste correctly.

@atifraza commented on GitHub (Jul 23, 2020): > Your text editor is in autoindent mode, but the pasted text contains literal whitespace. > > If I’m reading between the lines, this is a request for bracketed paste mode (so nano knows when to ignore the leading whitespace) > > /dup #395 Exactly, I did have `autoindent` enabled for nano. Disabling it allows to paste correctly.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9793