microsoft / microsoft/terminal

Support multi-code-point characters in TerminalInput::HandleKey

Open
#2,853 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Input Issue-Feature Product-Conhost Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

Description of the new feature/enhancement

Starting with #2836 key events containing combinations like Shift. (here: US keyboard layout) will be mapped to their matching, potentially non-ASCII, counterparts (here: >).
This is achieved using the ToUnicodeEx method.

But this leads to a problem: ToUnicodeEx can potentially return multiple code points.
TerminalInput::HandleKey and its KeyEvent parameter only accept a single code point though.

👉 TerminalInput and KeyEvent should be modified to accommodate multi-code-point characters (i.e. e.g. by replacing wchar_t with std::wstring).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/terminal/input/terminalInput.cpp at TerminalInput::HandleKey and the KeyEvent definition in src/types/inc/IInputEvent.hpp. Read the ToUnicodeEx behavior described in the issue and trace how the single code point is passed through these interfaces. Done means TerminalInput and KeyEvent accommodate the multiple code points returned for a key event.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.