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

Closed
opened 2026-01-31 02:26:30 +00:00 by claunia · 8 comments
Owner

Originally created by @Joe-Zer0 on GitHub (Sep 16, 2020).

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.

Originally created by @Joe-Zer0 on GitHub (Sep 16, 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: [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". <!-- A description of how to trigger this bug. --> # Expected behavior After pasting text into the terminal. Pressing "Ctrl+Z" should remove the entire text that was just pasted. <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> # Actual behavior After pasting text into the terminal. Pressing "Ctrl+Z" currently just removes one letter. <!-- What's actually happening? -->
claunia added the Resolution-Duplicate label 2026-01-31 02:26:30 +00:00
Author
Owner

@DHowett commented on GitHub (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 (https://github.com/PowerShell/PSReadLine/issues/1471), this will work better.

/dup #395

@DHowett commented on GitHub (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 <kbd>Ctrl+Z</kbd>, 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 (https://github.com/PowerShell/PSReadLine/issues/1471), this will work better. /dup #395
Author
Owner

@ghost commented on GitHub (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 commented on GitHub (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!
Author
Owner

@Joe-Zer0 commented on GitHub (Sep 16, 2020):

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

@Joe-Zer0 commented on GitHub (Sep 16, 2020): Doing directly in both PowerShell and PowerShell Core works. After pasting, hitting "Ctrl+Z" remove the entire pasted string.
Author
Owner

@DHowett commented on GitHub (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.

@DHowett commented on GitHub (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.
Author
Owner

@Andy-AO commented on GitHub (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?

@Andy-AO commented on GitHub (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?
Author
Owner

@nathanpovo commented on GitHub (May 10, 2024):

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

@nathanpovo commented on GitHub (May 10, 2024): I can see that #395 was closed in #9034 and released in [v1.7.572.0](https://github.com/microsoft/terminal/releases/tag/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`
Author
Owner

@zadjii-msft commented on GitHub (May 10, 2024):

As mentioned above in https://github.com/microsoft/terminal/issues/7647#issuecomment-693608879, #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 https://github.com/PowerShell/PSReadLine/issues/1471

@zadjii-msft commented on GitHub (May 10, 2024): As mentioned above in https://github.com/microsoft/terminal/issues/7647#issuecomment-693608879, #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 https://github.com/PowerShell/PSReadLine/issues/1471
Author
Owner

@nathanpovo commented on GitHub (May 10, 2024):

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.

@nathanpovo commented on GitHub (May 10, 2024): 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10648