Skip to content

fix(tui): disable enhanced keys for VS Code WSL#18741

Merged
fcoury-oai merged 2 commits into
mainfrom
fcoury/fix-vscode-wsl2-accented-chars
Apr 21, 2026
Merged

fix(tui): disable enhanced keys for VS Code WSL#18741
fcoury-oai merged 2 commits into
mainfrom
fcoury/fix-vscode-wsl2-accented-chars

Conversation

@fcoury-oai
Copy link
Copy Markdown
Contributor

@fcoury-oai fcoury-oai commented Apr 20, 2026

Fixes #13638

Why

VS Code's integrated terminal can run a Linux shell through WSL without exposing TERM_PROGRAM to 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

  • Automatically skip crossterm keyboard enhancement flags when Codex detects WSL plus VS Code, including a Windows-side TERM_PROGRAM probe through WSL interop.
  • Add CODEX_TUI_DISABLE_KEYBOARD_ENHANCEMENT so users can force-disable or force-enable the keyboard enhancement policy for diagnosis.

Verification

  • Added unit coverage for env parsing, VS Code detection, and the WSL/VS Code auto-disable policy.
  • cargo check -p codex-tui passed.
  • ./tools/argument-comment-lint/run.py -p codex-tui -- --tests passed.
  • cargo test -p codex-tui was attempted locally, but the checkout failed during linking before tests executed because V8 symbols from codex-code-mode were unresolved for arm64.
@fcoury-oai fcoury-oai marked this pull request as ready for review April 20, 2026 20:45
@fcoury-oai fcoury-oai force-pushed the fcoury/fix-vscode-wsl2-accented-chars branch 2 times, most recently from 16e563a to 7bdf170 Compare April 20, 2026 20:53
@fcoury-oai fcoury-oai changed the title [codex] Disable enhanced keys for VS Code WSL fix(tui): disable enhanced keys for VS Code WSL Apr 20, 2026
@fcoury-oai fcoury-oai force-pushed the fcoury/fix-vscode-wsl2-accented-chars branch from 7bdf170 to fea3b7b Compare April 20, 2026 20:59
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.
@fcoury-oai fcoury-oai force-pushed the fcoury/fix-vscode-wsl2-accented-chars branch from fea3b7b to fb623e8 Compare April 20, 2026 21:01
@fcoury-oai fcoury-oai merged commit 1101dec into main Apr 21, 2026
25 checks passed
@fcoury-oai fcoury-oai deleted the fcoury/fix-vscode-wsl2-accented-chars branch April 21, 2026 12:57
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants