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 Paste, Undo removes one character at a time #7647

Closed
Joe-Zer0 opened this issue Sep 16, 2020 · 8 comments
Closed

After Paste, Undo removes one character at a time #7647

Joe-Zer0 opened this issue Sep 16, 2020 · 8 comments
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@Joe-Zer0
Copy link

Environment

Windows build number:  [Environment]::OSVersion

Platform ServicePack Version      VersionString
-------- ----------- -------      -------------
 Win32NT             10.0.18362.0 Microsoft Windows NT 10.0.18362.0


Windows Terminal version (if applicable):  Version: 1.1.2021.0

Any other software?

Steps to reproduce

Paste any text into the terminal. Press "Ctrl+Z".

Expected behavior

After pasting text into the terminal. Pressing "Ctrl+Z" should remove the entire text that was just pasted.

Actual behavior

After pasting text into the terminal. Pressing "Ctrl+Z" currently just removes one letter.

@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 Sep 16, 2020
@DHowett
Copy link
Member

DHowett commented Sep 16, 2020

Paste works in almost all terminal emulators by printing the string character by character. In addition, the Terminal itself does not implement Ctrl+Z, so it is the job of the shell.

Once we support bracketed paste (#395) and PowerShell (which I presume you are using) supports bracketed paste (PowerShell/PSReadLine#1471), this will work better.

/dup #395

@ghost
Copy link

ghost commented Sep 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 Sep 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 Needs-Tag-Fix Doesn't match tag requirements labels Sep 16, 2020
@Joe-Zer0
Copy link
Author

Doing directly in both PowerShell and PowerShell Core works. After pasting, hitting "Ctrl+Z" remove the entire pasted string.

@DHowett
Copy link
Member

DHowett commented Sep 16, 2020

This is because powershell/core are handling ^V themselves. If you remove the ^V key binding, you can get this behavior back, but ^V will not work in CMD or WSL.

@Andy-AO
Copy link

Andy-AO commented Jan 18, 2021

So does this mean that basically can't get the same pasting effect in Windows Terminal as you can in PowerShell Core?

One time paste revocation is very convenient and has a high efficiency.

Not only does the built-in PowerShell Core terminal, but the PowerShell Integrated Console on Visual Studio Code also supports this feature. If I remember correctly, the latter is supposed to be cross-platform, so does that mean that this is still possible?

daniel-liuzzi added a commit to daniel-liuzzi/dotfiles that referenced this issue Mar 20, 2023
Workaround: this fixes a PowerShell issue where pressing Ctrl+Z after
pasting text removes it character by character, but also breaks Ctrl+V
in CMD and WSL. Revert this once bracketed paste support improves.

- microsoft/terminal#7647 (comment)
- microsoft/terminal#7647 (comment)
@nathanpovo
Copy link

I can see that #395 was closed in #9034 and released in v1.7.572.0 but I am still running into this issue.

It is not clear if any settings need to be changed for this to work but I saw no mention of a need to change settings in the linked issue and PR.


I am using:

Windows terminal version: 1.19.11213.0
Windows build number: 10.0.22631.0
Powershell version: 7.4.2

@zadjii-msft
Copy link
Member

As mentioned above in #7647 (comment), #9034 just added support to the Terminal for bracketed paste. PowerShell / PsReadline still needs to add support on their side, too. That's tracked in PowerShell/PSReadLine#1471

@nathanpovo
Copy link

Thanks for the links.

I had gone through #395 and #9034, and must have missed that there needs to be some work done in PSReadLine for this to be supported when PowerShell is hosted in Windows Terminal.

Based on that, the current workaround still seems to be to remove the Ctrl+V binding for "Paste" in Windows Terminal.

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

5 participants