Dead keys break in VS Code Remote SSH terminal on Linux
What issue are you seeing?
Follow-up to #13638: dead-key accent composition can still fail inside Codex when VS Code is attached to a native Linux host through Remote SSH. The new report in https://github.com/openai/codex/issues/13638#issuecomment-4458442938 reproduces this on an aarch64 Raspberry Pi + VS Code Remote SSH session, where the escape sequence ^[[13;1:3u leaks into the terminal and dead keys such as circumflex and grave do not produce accented characters.
What steps can reproduce the bug?
- Connect to a native Linux host through VS Code Remote SSH.
- Open the integrated terminal on that remote host.
- Run
codex. - Type a dead-key combination such as circumflex or grave followed by a vowel.
What is the expected behavior?
Dead-key composition should match the same VS Code terminal outside Codex.
Additional information
The current workaround is CODEX_TUI_DISABLE_KEYBOARD_ENHANCEMENT=1 codex. The suspected follow-up is to skip crossterm keyboard enhancement flags for Linux VS Code terminals, not just the original WSL + VS Code path fixed by #18741.
2 Comments
I tried to reproduce this more narrowly on an Ubuntu 24.04 ARM64 VM with the desktop set to US International dead keys.
Tested:
ubuntu@127.0.0.1CODEX_TUI_DISABLE_KEYBOARD_ENHANCEMENT=0Dead-key composition worked in both the local and Remote SSH VS Code terminals on that setup, so I still do not have evidence that all Linux VS Code terminals need the WSL workaround.
Could you share the exact failing setup:
CODEX_TUI_DISABLE_KEYBOARD_ENHANCEMENT=1 codexfixes itecho "$TERM_PROGRAM"cat -vafter pressing the dead-key sequenceIf we can get one distinguishing detail from the failing Raspberry Pi path, we can target the fix instead of widening the current WSL-only workaround speculatively.
Thanks for investigating, @fcoury-oai. Here's the exact failing setup and what we discovered:
Exact Failing Setup
^, grave ```, etc.)vscodeThe Problem
Dead keys didn't work in Codex CLI on this setup. Typing
^ owould leak escape sequences and produce justoinstead ofô.Root Cause
The keyboard_modes.rs code had this logic:
On a native Linux system (like this Debian Pi),
is_wsl()returns false. So even thoughrunning_in_vscode_terminal()would correctly detect VSCode, the entire condition evaluated to false, leaving keyboard enhancement enabled.With keyboard enhancement active in VSCode Remote SSH, the kitty protocol breaks dead key composition in the PTY forwarding through SSH.
The Fix (from PR #13638)
Removing the
is_wsl &&guard:Now it correctly detects VSCode on any Linux system, not just WSL. When running in VSCode (with
TERM_PROGRAM=vscodepresent), keyboard enhancement disables automatically, and dead keys compose correctly.Confirmation
✅ With the patch:
^ o→ô(works correctly)✅ TERM_PROGRAM=vscode is properly detected on Remote SSH
✅ No WSL involved — issue applies to any VSCode Remote SSH session to native Linux
Why Your Ubuntu Test Succeeded
On Ubuntu, the same detection would have worked if
TERM_PROGRAM=vscodewas set. The distinguishing detail is that the guard condition was the blocker, not the detection itself — it only worked on WSL, not on native Linux Remote SSH.The patch broadens the fix to cover all VSCode terminal scenarios, not just WSL-specific ones.
---
Does this cover all the details you needed? Let me know if you need any additional information to validate the fix.