microsoft / microsoft/terminal

Pass keyboard layout down to ConPTY and consider readding support for GetConsoleKeyboardLayoutName

Open
#18,160 0 comments 0 reactions 0 assignees View on GitHub
Area-Server Issue-Task Product-Conhost Product-Conpty
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

### Description of the new feature

To help PowerShell with their `ToUnicode` usage we should pass down the keyboard layout to ConPTY so that their keyboard-layout hack works:
https://github.com/PowerShell/PSReadLine/blob/e87a265ef8d2c6c5498500deb155bf6258b34629/PSReadLine/PlatformWindows.cs#L1106-L1109

To avoid the need for such a workaround, we should readd support for the existing `GetConsoleKeyboardLayoutName` function. There's not really a good reason to not support it. It's also used by vim and probably others so it may be quite helpful.

### Proposed technical implementation details

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by tracing how ConPTY receives keyboard-layout information and how the existing GetConsoleKeyboardLayoutName function is handled. Review the PowerShell PlatformWindows.cs usage linked in the issue and consider Vim's reported use case. Done means ConPTY passes the layout needed by ToUnicode and the existing function is supported again.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, powershell, vim
Domain
cli, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.