[Settings - Actions] Missing "Undo" (Ctrl+Z) Function Binding - Powershell #17389

Closed
opened 2026-01-31 05:41:00 +00:00 by claunia · 1 comment
Owner

Originally created by @PinkPanther901 on GitHub (May 2, 2022).

Windows Terminal version

1.12.10982.0

Windows build number

19044.1645

Other Software

Powershell 7.2.2

Steps to reproduce

  1. Copy some text content to paste (a URL, a string, a file hash, etc.)
  2. Run Windows Terminal with an equivalent Powershell 7.2.2 tab open
  3. Paste into the shell tab/window (via Shift+Insert, or custom Ctrl+V action declared in settings.json)
  4. Press Ctrl+Z

Expected Behavior

The pasted content is erased

Correct behavior: (Run from pwsh.exe directly, Ctrl+Z erases pasted content)
https://user-images.githubusercontent.com/22159142/166314691-4c83a7f0-0654-4e83-a40d-22f55d8ab677.mp4

Actual Behavior

One character is erased from end of line per press (same as backspace)

Broken behavior: (Ctrl+Z erases one character per press)
https://user-images.githubusercontent.com/22159142/166314614-6fec819f-2304-4b87-a457-baa738363128.mp4

Originally created by @PinkPanther901 on GitHub (May 2, 2022). ### Windows Terminal version 1.12.10982.0 ### Windows build number 19044.1645 ### Other Software Powershell 7.2.2 ### Steps to reproduce 1. Copy some text content to paste (a URL, a string, a file hash, etc.) 2. Run Windows Terminal with an equivalent Powershell 7.2.2 tab open 3. Paste into the shell tab/window (via Shift+Insert, or custom Ctrl+V action declared in settings.json) 4. Press Ctrl+Z ### Expected Behavior The pasted content is erased Correct behavior: (Run from pwsh.exe directly, Ctrl+Z erases pasted content) https://user-images.githubusercontent.com/22159142/166314691-4c83a7f0-0654-4e83-a40d-22f55d8ab677.mp4 ### Actual Behavior One character is erased from end of line per press (same as backspace) Broken behavior: (Ctrl+Z erases one character per press) https://user-images.githubusercontent.com/22159142/166314614-6fec819f-2304-4b87-a457-baa738363128.mp4
Author
Owner

@zadjii-msft commented on GitHub (May 3, 2022):

Huh, well, that kinda makes sense. When the Terminal pastes with its action, it actually sends each keystroke individually. Compare that with the original powershell's Ctrl+V handler, where they actually opened the clipboard themselves and added the contents to the input buffer in one go, themselves.

You can get a similar behavior in Windows Terminal by actually unbinding Ctrl+V. That'll let the key fall through to powershell, and then they'll do their thing to paste the clipboard contents manually.

@zadjii-msft commented on GitHub (May 3, 2022): Huh, well, that kinda makes sense. When the Terminal pastes with its action, it actually sends each keystroke individually. Compare that with the original powershell's `Ctrl+V` handler, where they actually opened the clipboard themselves and added the contents to the input buffer in one go, themselves. You can get a similar behavior in Windows Terminal by actually unbinding `Ctrl+V`. That'll let the key fall through to powershell, and then they'll do their thing to paste the clipboard contents manually.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17389