Repository navigation
Description
What version of Codex CLI is running?
codex-cli 0.160.0 (verified while preparing these reports).
What subscription do you have?
ChatGPT Plus.
Which model were you using?
Not confirmed for every occurrence.
What platform is your computer?
Linux 6.18.40.1-microsoft-standard-WSL2 x86_64 x86_64
What terminal emulator and version are you using (if applicable)?
VS Code integrated terminal, version 1.139.1 as reported by Codex doctor earlier in this conversation. Ubuntu 22.04 under WSL2. Codex Fullscreen TUI mode.
Codex doctor report
Not attached. Earlier diagnostics were collected inside an execution sandbox and included sandbox-related network failures and unrelated private local state.
What issue are you seeing?
Clicking a local file link in a Codex session consistently inserts the literal text aN;NaNm into the message composer. My intended action is to open the file, not enter any text.
This happens with local paths shown in command output and with a local Markdown file link supplied by Codex. I reproduced it again during preparation of this report: Codex supplied a local file link, I clicked it, and the next message contained exactly aN;NaNm.
Closing Codex with Ctrl+C also produces repeated fragments of this kind. Sometimes I see 2–4 repetitions in sequence, and other times many appear. I do not know what determines when this happens or how many repetitions appear. This shutdown symptom has not been isolated, and I have not established whether it has the same cause as the consistently reproducible link-click behavior.
Exact examples of text appearing after closing sessions:
After closing one session:
51;47;10M51;43;6M51;40;4M51;39;3M51;38;3M35;38;3M
After closing a different session:
51;40;24M
What steps can reproduce the bug?
- Run Codex CLI in Fullscreen TUI mode in the VS Code integrated terminal under WSL2.
- Ask Codex to display a clickable link to an existing local file, for example
[Open example](/absolute/path/to/example.md). - Activate that local file link using the terminal's link-opening gesture.
- Observe
aN;NaNminserted into the Codex message composer without typing those characters.
I reproduced this multiple times while preparing the report. The exact raw terminal input bytes have not been captured.
What is the expected behavior?
Opening a local file link should not insert terminal-control fragments or other unintended text into the message composer.
Exiting Codex should also restore terminal input state so subsequent mouse activity does not produce control-sequence fragments at the shell prompt.
Additional information
The visible fragment is consistent with leaked mouse-reporting input, but the root cause is unconfirmed. Please investigate the interaction between VS Code terminal link activation, Codex input parsing, and terminal cleanup on exit.
Related reports:
- [Bug] CLI inputs terminal mouse escape sequences (e.g., [M#\6) when moving mouse #49126 describes mouse escape sequences entering the Codex prompt in Windows Terminal. Its reported sequence and trigger differ from this local-file-link reproduction.
- Inertial fling sends NaN mouse coordinates when mouse reporting is on xtermjs/xterm.js#6108 reports literal NaN mouse coordinates during touch scrolling. This report concerns desktop link activation; it does not establish the same underlying cause.
Private local paths and full session logs are omitted. The reproduction only needs a link to an existing local file.
Activity
etraut-openai commentedon Oct 10, 2026
(response from codex)
Investigation note
High confidence in a Crossterm parser defect; the original VS Code trigger is still unconfirmed.
Codex 0.160.0 enables SGR mouse reporting in fullscreen. In its pinned Crossterm fork, the Unix readers feed input to the parser byte by byte. For the hypothetical malformed report:
parse_csi_sgr_mousewaits forMorm, but the reader treats the firstNas a completed CSI sequence and clears its buffer. The remaining bytes become ordinary key events: exactlyaN;NaNm. This occurs in both themioanduse-dev-ttyreaders. Relevant public sources:A local regression test feeding that sequence reproduced the unexpected
Char('a'). A small, bounded exception for theN,Na, andNaNprefixes inside SGR coordinates let the existing parser discard the entire malformed report atM/m, preserving the next real key. Both Unix backend suites passed with that experimental change. Nothing has been shipped for this issue.The missing piece is the actual terminal input for the reporter's Ctrl+click. A VS Code 1.139.1 / Codex 0.160.0 / WSL2 test on Ubuntu 26.04 produced only valid numeric reports on ordinary clicks. Opening the file through “Terminal: Open Detected Link” and exiting with Ctrl+C were also clean. That test could not exercise Ctrl+click and did not match the reporter's Ubuntu 22.04, so it does not rule out the report.
Next step: capture raw terminal input for the exact link-opening gesture using a disposable local file. No account logs or private project paths are needed. If it contains
ESC[<...;NaN;NaNm, address it in the Crossterm fork and then update Codex's pin. Do not filter the literal text in the composer. Keep shutdown leakage separate unless a capture establishes the same cause; the tested exit path disabled mouse modes correctly.Discard SGR mouse reports with NaN coordinates on Unix (#22)