tui: add --no-keyboard-enhancement for terminal compatibility

Resolved 💬 1 comment Opened Feb 26, 2026 by wegel Closed Apr 3, 2026

Summary

Add a TUI CLI flag to disable keyboard enhancement escape modes:

  • --no-keyboard-enhancement

Why

Some terminals show broken behavior when keyboard enhancements are enabled. A concrete case is foot, where copy shortcuts like Ctrl+Shift+C can trigger unexpected focus/refocus behavior back to the input box.

A flag-based opt-out provides a minimal compatibility path without changing defaults for terminals where enhancements work correctly.

Proposed behavior

  • New flag: codex --no-keyboard-enhancement
  • Also supported via codex resume --no-keyboard-enhancement
  • Default behavior remains unchanged (enhancements enabled unless explicitly disabled)

Ready implementation

I have a complete, tested implementation in my fork:

Validation run

  • cargo test -p codex-cli resume_no_keyboard_enhancement_flag_sets_mode -- --nocapture
  • Manual verification in foot: copy behavior works correctly with --no-keyboard-enhancement

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗