iTerm2 Command shortcuts captured when keyboard enhancement is enabled
Open 💬 1 comment Opened Aug 27, 2026 by hawaiigal
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
What version of Codex CLI is running?
0.150.0
What subscription do you have?
Enterprise
Which model were you using?
gpt-5.6
What platform is your computer?
macOS: 26.6 (25G72)
What terminal emulator and version are you using (if applicable)?
iTerm2: 3.6.11
Codex doctor report
What issue are you seeing?
While the Codex TUI is active in iTerm2, macOS/iTerm shortcuts such as
Cmd+V and Cmd+N stop working. Edit → Paste still works.
Apple Terminal is unaffected.
Workaround:
CODEX_TUI_DISABLE_KEYBOARD_ENHANCEMENT=1 codex
Expected: Codex should not capture iTerm/macOS Command shortcuts.
What steps can reproduce the bug?
Opening codex in iterm2 and attempting to paste text
What is the expected behavior?
The text pastes into the prompt
Additional information
_No response_
1 Comment
This looks consistent with an iTerm2 keyboard setting. Codex enables the Kitty keyboard protocol, which can activate Command-key remappings that don’t apply at the shell prompt.
Could you check Settings → Profiles → your active profile → Keys → General, specifically the left and right Command-key settings? If either is mapped to Hyper, Meta, or Super, restore its default Command behavior and retry Codex without
CODEX_TUI_DISABLE_KEYBOARD_ENHANCEMENT.If both already use their defaults, please share a screenshot of those settings and whether this reproduces with a fresh default profile. That will help distinguish a configuration issue from a terminal compatibility bug.
Could you also use
/keymap debugto check what iTerm sends to Codex?CODEX_TUI_DISABLE_KEYBOARD_ENHANCEMENT=1./keymap debugto open the Keypress Inspector.If the raw event shows
SUPER,HYPER, orMETAfor a Command shortcut, that would support the iTerm remapping explanation.Note: The inspector displays key events, not pasted text. No change after Cmd+V isn’t itself a failure; close the inspector and test actual pasting at the normal prompt.