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

After pasting, Ctrl+z deletes character by character instead of undoing the whole string #4745

Closed
alexhinz opened this issue Feb 28, 2020 · 2 comments
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@alexhinz
Copy link

Environment

Windows build number: 10.0.19569.1000
Windows Terminal version: 0.9.433.0

Steps to reproduce

  1. Copy some text to clipboard from any source (Terminal, Notepad, browser, etc.), e.g. "hello world"
  2. Open a Windows PowerShell tab or PowerShell Core tab in Terminal.
  3. Paste the text by any usual means: right click, Ctrl+Shift+v, Ctrl+v (if configured in settings json).
  4. Press Ctrl+z. Observe, repeat.

Expected behavior

With a single Ctrl+z press, the whole "hello world" string should be deleted. This behavior matches PowerShell when not running inside Terminal.

Actual behavior

Each press of Ctrl+z deletes a single letter/character, as if by pressing Backspace.

In contrast, I see that if I use the up/down arrows to insert strings of text, Ctrl+z correctly deletes the whole string, which matches the behavior of PowerShell outside of Terminal.

My PSReadline version is 2.0.0, according to Get-Module PSReadline.

@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 Feb 28, 2020
@DHowett-MSFT
Copy link
Contributor

Unfortunately, this is because PSReadline is handling ^V itself in the traditional console case. When Terminal handles it, it inputs the pasted string a single character at a time like all other terminals.

This will be fixed when we have bracketed paste mode[1] and PSReadline supports asking for it.

/dup #395

[1]: "Bracketed paste" is a terminal feature whereby a terminal can say "I am beginning/ending a paste" so that a remote shell can do the right thing with user-pasted content that it received char-by-char.

@ghost
Copy link

ghost commented Feb 28, 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 Feb 28, 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 Needs-Tag-Fix Doesn't match tag requirements labels Feb 28, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

2 participants