Skip to content

Character based key handlers are not surrogate pair aware #1587

Open
@SeeminglyScience

Description

@SeeminglyScience

Environment

PS version: 7.0.0
PSReadline version: 2.0.0
os: 10.0.18362.1 (WinBuild.160101.0800)
PS file version: 7.0.0.0
HostName: ConsoleHost
BufferWidth: 140
BufferHeight: 3000

Exception report

Steps to reproduce

  1. Copy a surrogate pair to clipboard (like 😀)
  2. In a terminal that supports emojis, paste it
  3. Press Backspace

Expected behavior

The buffer is empty.

Actual behavior

The buffer contains the high surrogate of the pasted surrogate pair.


This also applies to most character level handlers, including:

  • ForwardChar
  • BackwardChar
  • DeleteChar
  • Delete

And their VI variants.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions