Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pasting Still Badly Broken From Windows to Ubuntu: Extra Line Endings and Indents #4915

Closed
FlipperPA opened this issue Mar 14, 2020 · 4 comments
Labels
Area-Input Related to input processing (key presses, mouse, etc.) Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Conpty For console issues specifically related to conpty Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@FlipperPA
Copy link

FlipperPA commented Mar 14, 2020

Environment

Windows build number: 10.0.19041.113
Windows Terminal version (if applicable): 0.9.433.0

Any other software? Ubuntu 18.04, mainly used for Python 3 development.

Steps to reproduce

Create a few lines of code in a text editor, such as Sublime or Notepad, and COPY it:
image

Result of pasting into a Terminal with an ipython shell open:
image
** NOTE THE EXTRA LINE FEEDS AND INDENTATION! **

Result of pasting into a Terminal with vi open:
image
** NOTE THE EXTRA LINE FEEDS AND INDENTATION! **

Result of pasting the same text buffer into PuTTY with an ipython shell open:
image
** It looks perfect! Beautiful! **

Result of pasting the same text buffer into PuTTY with the vi editor open:
image
** It looks perfect! Beautiful! **

The same behavior happens with emacs, pico, vim - not just vi and ipython.

Expected behavior

For the copied buffer to properly paste, like it does in PuTTY, without extra line endings and indents.

Please note that the same text buffer pasted into a PowerShell window works:
image

Actual behavior

See the above screenshots. I end up having to paste code from scratch text editors on Windows into Windows Terminal Preview line-by-line. This gets very old, very fast!

Thanks for your efforts, this is shaping up to be a great product. This is my one, huge, major pain point.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Mar 14, 2020
@zadjii-msft
Copy link
Member

You know, I bet this is actually caused by bracketed paste mode. @DHowett-MSFT can probably confirm my suspicion, since he's the expert in that area

@zadjii-msft zadjii-msft added Area-Input Related to input processing (key presses, mouse, etc.) Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Conpty For console issues specifically related to conpty labels Mar 16, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Mar 16, 2020
@DHowett-MSFT
Copy link
Contributor

So, I copied this out of notepad;
image

@DHowett-MSFT
Copy link
Contributor

But come to think of it, yes, @zadjii-msft is totally right here. Vi and ipython (probably) request "bracketed paste" mode -- it's a mode that lets the receiving application know that it's receiving a pasted block of text, and it can use that to defer processing the pasted text. Since we don't support it, ipython and vi are immediately processing the pasted text as though the user typed it.

Vim usually uses it to :set paste (which will suppress indentation, among other things).

That'll make this a /dup of #395

@ghost
Copy link

ghost commented Mar 16, 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 ghost closed this as completed Mar 16, 2020
@ghost ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Mar 16, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Input Related to input processing (key presses, mouse, etc.) Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Conpty For console issues specifically related to conpty Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

3 participants