fix(tui): disable enhanced keys for VS Code WSL#18741
Merged
Merged
Conversation
16e563a to
7bdf170
Compare
7bdf170 to
fea3b7b
Compare
Skip crossterm keyboard enhancement flags automatically for VS Code integrated terminals running under WSL, where dead-key composition can produce malformed key events instead of composed Unicode input. Add an override env var so users can force-disable or force-enable the keyboard enhancement policy for diagnosis in other terminal sessions.
fea3b7b to
fb623e8
Compare
canvrno-oai
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #13638
Why
VS Code's integrated terminal can run a Linux shell through WSL without exposing
TERM_PROGRAMto the Linux process, and with crossterm keyboard enhancement flags enabled that environment can turn dead-key composition into malformed key events instead of composed Unicode input. Codex already handles composed Unicode correctly, so the fix is to avoid enabling the terminal mode that breaks this path for the affected terminal combination.What Changed
TERM_PROGRAMprobe through WSL interop.CODEX_TUI_DISABLE_KEYBOARD_ENHANCEMENTso users can force-disable or force-enable the keyboard enhancement policy for diagnosis.Verification
cargo check -p codex-tuipassed../tools/argument-comment-lint/run.py -p codex-tui -- --testspassed.cargo test -p codex-tuiwas attempted locally, but the checkout failed during linking before tests executed because V8 symbols fromcodex-code-modewere unresolved forarm64.