Skip to content

fix(tui): disable REPORT_ALTERNATE_KEYS on Windows to prevent Mouse Properties dialog#9371

Closed
Flewrider wants to merge 2 commits intoopenai:mainfrom
Flewrider:fix/windows-mouse-properties-dialog
Closed

fix(tui): disable REPORT_ALTERNATE_KEYS on Windows to prevent Mouse Properties dialog#9371
Flewrider wants to merge 2 commits intoopenai:mainfrom
Flewrider:fix/windows-mouse-properties-dialog

Conversation

@Flewrider
Copy link
Copy Markdown

Summary

Fixes #9370

When running Codex on Windows, the Mouse Properties control panel dialog (main.cpl) sometimes opens unexpectedly during normal TUI usage.

Root Cause

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.

Solution

Conditionally disable REPORT_ALTERNATE_KEYS on Windows using #[cfg(not(windows))]:

let flags = KeyboardEnhancementFlags::DISAMBIGUATE_ESCAPE_CODES
    | KeyboardEnhancementFlags::REPORT_EVENT_TYPES;

// REPORT_ALTERNATE_KEYS causes issues on Windows Terminal/conpty where certain
// escape sequences can be misinterpreted as system keyboard shortcuts that
// trigger control panel applets (e.g., Mouse Properties dialog).
#[cfg(not(windows))]
let flags = flags | KeyboardEnhancementFlags::REPORT_ALTERNATE_KEYS;

let _ = execute!(stdout(), PushKeyboardEnhancementFlags(flags));

The other two flags (DISAMBIGUATE_ESCAPE_CODES and REPORT_EVENT_TYPES) are sufficient for Shift+Return functionality on Windows.

Files Changed

  • codex-rs/tui/src/tui.rs - Original TUI
  • codex-rs/tui2/src/tui.rs - New TUI
  • codex-rs/cloud-tasks/src/lib.rs - Cloud tasks UI

Testing

  • Built and tested locally on Windows 11
  • Verified Shift+Return still works for newlines
  • Mouse Properties dialog no longer appears during usage

…roperties dialog

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 like the Mouse Properties dialog (main.cpl).

This change conditionally disables REPORT_ALTERNATE_KEYS on Windows while
keeping DISAMBIGUATE_ESCAPE_CODES and REPORT_EVENT_TYPES enabled, which
are sufficient for Shift+Return functionality.

Affected files:
- codex-rs/tui/src/tui.rs
- codex-rs/tui2/src/tui.rs
- codex-rs/cloud-tasks/src/lib.rs
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 16, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@Flewrider
Copy link
Copy Markdown
Author

Flewrider commented Jan 16, 2026

Screenshot of the issue

The Mouse Properties dialog that unexpectedly opens during Codex usage on Windows:

Screenshot 2026-01-16 151441

@Flewrider
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Jan 16, 2026
@etraut-openai
Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. 👍

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@etraut-openai etraut-openai added the needs-response Additional information is requested label Jan 20, 2026
@etraut-openai
Copy link
Copy Markdown
Collaborator

@Flewrider, thanks for the additional details you provided in the bug report thread. Based on this, I think we're going to pass on this PR. We don't have a strong enough understanding of the causal link between the proposed fix and the root cause of the issue. That makes the change risky because it could have other side effects that we don't understand.

I'm going to close the PR, but we can keep the bug report open for now. If you'd like to continue to do more exploration to understand the root cause, you're welcome to do so. We probably won't invest any more time in this unless we hear from other Codex users that they're seeing a similar problem. So far, you're the only one who has reported this.

@etraut-openai etraut-openai removed the needs-response Additional information is requested label Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mouse Properties dialog opens unexpectedly on Windows

2 participants