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

Closed
opened 2026-01-31 00:43:52 +00:00 by claunia · 2 comments
Owner

Originally created by @alexhinz on GitHub (Feb 28, 2020).

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.

Originally created by @alexhinz on GitHub (Feb 28, 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 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). 3. 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`.
claunia added the Resolution-Duplicate label 2026-01-31 00:43:52 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Feb 28, 2020):

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.

@DHowett-MSFT commented on GitHub (Feb 28, 2020): 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.
Author
Owner

@ghost commented on GitHub (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 commented on GitHub (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!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#6651