backspace breaks apart multibyte characters #18551

Closed
opened 2026-01-31 06:17:29 +00:00 by claunia · 4 comments
Owner

Originally created by @aetonsi on GitHub (Sep 26, 2022).

Windows Terminal version

1.14.2282.0

Windows build number

10.0.22000.978

Other Software

powershell core

Name             : ConsoleHost
Version          : 7.2.6
InstanceId       : 098117ae-601b-414f-851f-2c7afccd06c4
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : it-IT
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

Steps to reproduce

  1. copy multibyte character to clipboard, for example 🙂
  2. paste it in the terminal
  3. press backspace

Expected Behavior

The backspace should delete the entire multibyte character, so typing echo "🙂<backspace>" <enter> in pwsh would be the same as typing echo "" <enter> (should print an empty string).

Actual Behavior

When pressing backspace, the character is instead broken in a couple of � � characters, and the backspace deletes the second �, leaving the first one, which, if sent to pwsh, breaks everything (see here: https://github.com/PowerShell/PSReadLine/issues/2358#issuecomment-1258562344)

Originally created by @aetonsi on GitHub (Sep 26, 2022). ### Windows Terminal version 1.14.2282.0 ### Windows build number 10.0.22000.978 ### Other Software powershell core ``` Name : ConsoleHost Version : 7.2.6 InstanceId : 098117ae-601b-414f-851f-2c7afccd06c4 UI : System.Management.Automation.Internal.Host.InternalHostUserInterface CurrentCulture : it-IT CurrentUICulture : en-US PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy DebuggerEnabled : True IsRunspacePushed : False Runspace : System.Management.Automation.Runspaces.LocalRunspace ``` ### Steps to reproduce 1. copy multibyte character to clipboard, for example 🙂 2. paste it in the terminal 3. press backspace ### Expected Behavior The backspace should delete the entire multibyte character, so typing `echo "🙂<backspace>" <enter>` in `pwsh` would be the same as typing `echo "" <enter>` (should print an empty string). ### Actual Behavior When pressing backspace, the character is instead broken in a couple of � � characters, and the backspace deletes the second �, leaving the first one, which, if sent to `pwsh`, breaks everything (see here: https://github.com/PowerShell/PSReadLine/issues/2358#issuecomment-1258562344)
claunia added the Needs-TriageIssue-BugResolution-Won't-Fix labels 2026-01-31 06:17:29 +00:00
Author
Owner

@aetonsi commented on GitHub (Sep 26, 2022):

might be related to #12537 or #1802

@aetonsi commented on GitHub (Sep 26, 2022): might be related to #12537 or #1802
Author
Owner

@DHowett commented on GitHub (Sep 26, 2022):

Thanks for the report! Unfortunately, the handling of multi-byte sequences at a shell's "input line" is up to that shell. You may need to reopen this issue over on the PowerShell or PSReadline repository. Sorry!

@DHowett commented on GitHub (Sep 26, 2022): Thanks for the report! Unfortunately, the handling of multi-byte sequences at a shell's "input line" is up to that shell. You may need to reopen this issue over on the PowerShell or PSReadline repository. Sorry!
Author
Owner

@aetonsi commented on GitHub (Sep 27, 2022):

FYI and future reference see here: https://github.com/PowerShell/PSReadLine/issues/2358#issuecomment-1258562344

@aetonsi commented on GitHub (Sep 27, 2022): FYI and future reference see here: https://github.com/PowerShell/PSReadLine/issues/2358#issuecomment-1258562344
Author
Owner

@DHowett commented on GitHub (Sep 27, 2022):

Thank you! 😄

@DHowett commented on GitHub (Sep 27, 2022): Thank you! :smile:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18551