charmbracelet / charmbracelet/x

input doesn't handle NUM_LOCK properly on Windows

Open
#485 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
314
Forks
94
Avg merge
3d 22h
Merged PRs (30d)
2

Description

### Describe the bug

`Text` is `""` if numlock is enabled on the keyboard.

Culprit: https://github.com/charmbracelet/x/blob/19b66ab4499be69e337700b9adf0c550a47830ba/input/driver_windows.go#L468-L471

`cks` is 0x20 (I think) when numlock is pressed.

### Setup

- Windows 10
- Windows Terminal

### To Reproduce

I tested with github.com/stt/opencode. I can't type into the prompt box unless I turn off numlock on my keyboard.

### Source Code

I don't have a minimal repro, sorry.

### Expected behavior

numlock should not affect the input of normal characters (a-z keys).

Contributor guide

Open the contributing guide

Research direction

Start in input/driver_windows.go at lines 468-471 and inspect how the cks value is handled when Num Lock is enabled. Reproduce the issue on Windows 10 in Windows Terminal with Num Lock on, then verify that normal a-z input produces non-empty Text without being affected by Num Lock.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.