Mouse Properties dialog opens unexpectedly on Windows
What version of Codex is running?
Latest main branch (rust-v0.2.0-alpha.2)
What subscription do you have?
N/A - this is a terminal/keyboard handling bug
Which model were you using?
N/A - occurs regardless of model
What platform is your computer?
Windows 11 (Version 10.0.26100.7462) x64
What terminal emulator and version are you using?
Windows Terminal
What issue are you seeing?
When using Codex on Windows, the Mouse Properties control panel dialog (main.cpl) sometimes opens unexpectedly during normal usage.
<!-- Screenshot will be added in a comment below -->
What steps can reproduce the bug?
The issue is intermittent and depends on specific timing of escape sequences. It occurs during normal TUI usage but is not reliably reproducible on demand.
What is the expected behavior?
The Mouse Properties dialog should never open - Codex should only interact with the terminal, not trigger Windows control panel applets.
Root Cause Analysis
The REPORT_ALTERNATE_KEYS keyboard enhancement flag (part of Kitty Keyboard Protocol) causes issues on Windows Terminal/conpty. When enabled, certain escape sequences can be misinterpreted as system keyboard shortcuts that trigger control panel applets.
The problematic code (in all TUI variants):
PushKeyboardEnhancementFlags(
KeyboardEnhancementFlags::DISAMBIGUATE_ESCAPE_CODES
| KeyboardEnhancementFlags::REPORT_EVENT_TYPES
| KeyboardEnhancementFlags::REPORT_ALTERNATE_KEYS // <-- PROBLEM
)
Proposed Fix
Conditionally disable REPORT_ALTERNATE_KEYS on Windows using #[cfg(not(windows))]. The other two flags (DISAMBIGUATE_ESCAPE_CODES and REPORT_EVENT_TYPES) are sufficient for Shift+Return functionality.
A PR with this fix is forthcoming.
16 Comments
Screenshot
The Mouse Properties dialog that unexpectedly opens during Codex usage:
<!-- @Flewrider: Please edit this comment to add your screenshot by dragging and dropping the image here -->
---
Fix submitted in #9371
Have you reported this upstream to the Windows Terminal GitHub? If so, can you link to the issue? If not, please file one and include analysis there as well. Ideally, nothing we do at the application level should be able to trigger this kind of behavior, so we should first establish whether this is a terminal bug and how it is being invoked.
Could you also go deeper on the analysis section here? I am missing a concrete causal step that explains how the proposed change prevents the dialog from opening. Right now, it is hard to validate that this specific flag is responsible, or that disabling it is sufficient, without a clearer explanation of the sequence of events that leads to the issue.
No I havent reported it upstream. And I can‘t really tell you how to trigger the issue. I just know that it only happens while codex is running in Windows Terminal in Powershell. I gave the issue to claude code and it deciphered that those flags should be the issue. I have tested it for a while and the Window didnt pop up again but that could also be pure luck since it‘s super random when it happens. Never had that issue with other clis.
I dont have time to go further in this so if noone else is reporting this happening we can close the issue too.
So far, no one else has reported this issue. We can keep the bug report open for a while to see if anyone else reports it.
If you still have the Claude session and can rehydrate it, would you mind asking it to spell out the concrete causal chain that links this flag to the Mouse Properties dialog opening?
Right now we’re missing the step that explains how disabling
REPORT_ALTERNATE_KEYSprevents the dialog from triggering, which makes it hard to validate that this is the actual root cause rather than a coincidence.Claudes rundown on the issue is this:
------------------
What We Know (Facts)
modifiers u format (https://sw.kovidgoyal.net/kitty/keyboard-protocol/)
icrosoft.com/en-us/topic/how-to-run-control-panel-tools-by-typing-a-command-bce95b4d-e8c2-1cd0-ee0d-027679d520a6)
What We Don't Know (Gaps)
Windows to launch a Control Panel applet
would result in control main.cpl being executed
Honest Assessment
The investigation identified REPORT_ALTERNATE_KEYS as a suspect because:
But I cannot provide a concrete sequence X → conpty bug Y → main.cpl launch chain.
To properly prove causation, you'd need:
---------------
This doesnt seem to be very specific.
I found this random stackoverflow post from 8 years ago (thank god for stackoverflow and reddit am i right): Why does running main in powershell open my mouse properties
which seems to be correlated to my issue.
-> I can confirm typing main in my terminal opens the dialog window.
Claudes assessment on the issue:
---------------
The "main" → main.cpl
On Windows:
The Missing Link
What we still don't know: How does Codex cause "main" to be executed as a shell command?
Possible mechanisms based on https://github.com/microsoft/terminal/issues/1965:
Theory A: Escape sequence corruption → literal text
Theory B: Input mode confusion
What Would Prove This
To establish the actual causal chain, you'd need to:
The current fix (disabling REPORT_ALTERNATE_KEYS on Windows) may work by reducing the complexity of escape sequences sent, making ConPTY corruption less likely—but it's treating a symptom rather than a proven root
Do you want me to help add some debug logging to capture terminal I/O so we can catch the actual trigger?
-> it does seem to be based on some escape character issues making main (my project im working on has a main section since its next.js based) be interpreted as a command.
(sry for formatting i dont know why that one part is a weird code block)
Ok, we're going to close out the PR for now.
At this point we really need a proper minimal reproducible example. The current theory is plausible, but without a concrete repro chain it’s hard to validate that this flag is the actual cause rather than a coincidence.
One possible next step would be to use your preferred coding agent to build a very small executable test harness and explore it until you can identify the exact sequence of events that triggers the dialog. Capturing raw terminal I/O when it happens would likely be necessary to prove causation here.
We’d prefer not to disable
REPORT_ALTERNATE_KEYSat this time for two reasons:I’m going to close the PR for now, but please feel free to continue investigating a minimal repro. If you do find one, we’d be open to a more narrowly scoped change, such as disabling this only for Windows Terminal rather than Windows as a whole.
I’m experiencing the same issue. It happens at seemingly random moments and the Mouse Properties window suddenly opens.
In my case, this occured twice while using the Codex plugin in Visual Studio Code on Windows. I haven't encountered this problem when using Codex CLI so far.
I noticed it happen twice today both times when the agent used this:
• Ran Get-Content app\(main)\admin\settings\page.tsx
└ Get-Content:
Line |
2 | Get-Content app\(main)\admin\settings\page.tsx
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| A positional parameter cannot be found that accepts argument '$null'.
and both time when it failed with the same message.
I also experience the same issue using codex in powershell on windows. Can't consistently reproduce it but it does happen when working on a repo with (main) in the path, e.g.
src/routes/(main)/+page.svelteEdit - caught it opening today, here is the line that triggered it:
edit2: here's another one that just opened the mouse properties window.
It's still intermittent, it will often successfully run
git diffon files inside the (main) folder with no issue.Confirming this also happens using the VS code Codex extension
0.4.71directly.this issue is still active on version
0.4.74happens in 0.4.76 vscode extension. opens 3-4 mouse properties (idk, maybe more?). can't repro consistently.
0.4.78 - haven't experienced this again.
Hi, I'm not really familiar with github, but i noticed this discussion when googling, and i must mention this issue has happened to me when interacting with external api's in both codex and google's antigravity.
Edit: I see a user using claude also gets this issue: https://www.reddit.com/r/codex/comments/1rsx91r/codex_casually_opens_mouse_properties_on_windows/
This is happening to me too. Super annoying when using Codex.
<img width="419" height="469" alt="Image" src="https://github.com/user-attachments/assets/48207036-2542-41fb-8b21-07f14ba87ca3" />