Skip to content

Send Ctrl+C for Super+C when Codex is focused - #13634

Closed
AnPod wants to merge 3 commits into
omacom:quattrofrom
AnPod:cursor/fix-codex-super-c-e0d3
Closed

AnPod wants to merge 3 commits into
omacom:quattrofrom
AnPod:cursor/fix-codex-super-c-e0d3

Conversation

@AnPod

@AnPod AnPod commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #13413

Codex CLI 0.157.1 breaks Super+C universal copy in its terminal UI.

Change

  • Prefer Ctrl+C for Super+C while Codex is focused
  • Add a static binding coverage test

Test plan

  • Focused clipboard binding test on the branch
  • In Codex TUI, Super+C copies instead of interrupting

@jandrusk

jandrusk commented Oct 7, 2026

Copy link
Copy Markdown

Thanks for this. Two problems I found reading it against quattro:

The new test fails on this branch. test/shell.d/codex-super-c-test.sh requires

o.bind("SUPER + C", "Universal copy", universal_clipboard_shortcut("CTRL", "C", "CTRL", "Insert"))

but default/hypr/bindings/clipboard.lua on both the base and this head binds the terminal chord as "CTRL SHIFT", "C", so that grep fails. The comment saying Super+C sends Ctrl+Insert in terminals is out of date for the same reason.

Matching "codex" anywhere in the class or title can send SIGINT. In a terminal, this branch sends a plain Ctrl+C whenever the window title contains "codex". Terminal titles usually show the cwd or the running command, so ~/src/codex-plugins, vim codex.md or tail -f codex.log would all get Ctrl+C from Super+C, which interrupts the foreground process instead of copying. Even inside Codex, Ctrl+C with nothing selected interrupts the running turn. If this goes ahead, I'd match something much narrower, like the org.omarchy.agent class omarchy-agent uses, or an exact title prefix Codex sets. And I'd want the issue's open question answered first: does a direct Ctrl+Shift+C copy in Codex 0.157.1? If it does, the problem is the chord dispatch, not the key choice.

cursoragent and others added 3 commits October 9, 2026 07:20
Codex 0.157+ copies with Ctrl+C in its TUI; Super+C was synthesizing the terminal Ctrl+Insert chord that never reaches Codex.

Co-authored-by: AnPod <AnPod@users.noreply.github.com>
Add a static clipboard binding test so the Codex Ctrl+C preference is checked in environments without lua.

Co-authored-by: AnPod <AnPod@users.noreply.github.com>
Match the exact org.omarchy.agent class instead of any window whose class
or title contains "codex", so terminals titled e.g. "vim codex.md" keep
the normal Ctrl+Shift+C copy chord. Align the test with the real terminal
binding and fix the stale Ctrl+Insert comment.
@AnPod
AnPod force-pushed the cursor/fix-codex-super-c-e0d3 branch from 1922279 to 4ff5368 Compare October 9, 2026 05:20
@greptile-apps

greptile-apps Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium impact] Changes keyboard shortcut behavior for copy in terminal windows.

Fix the unintended Super+V change before merging.

Findings

  1. P1 Agent terminals lose normal paste ▶

Summary

This PR sends Ctrl+C for Super+C in windows with class org.omarchy.agent and adds a Lua-backed binding test.

  • The exception also changes Super+V, bypassing terminal clipboard paste.
  • The new test checks copy but does not catch the paste regression.

Reviews (1) · Last reviewed commit: "Only send Ctrl+C for the dedicated Codex..." · Reviewed by Greptile

Comment on lines +50 to +51
if active_window_wants_app_copy() then
send_shortcut_once(default_mods, default_key)()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Agent terminals lose normal paste

Both copy and paste use universal_clipboard_shortcut, so this copy exception also makes Super+V send Ctrl+V instead of Ctrl+Shift+V in every org.omarchy.agent window. These are terminal windows. The shipped Foot settings, for example, bind clipboard paste to Control+Shift+v, not Control+v. The terminal therefore no longer pastes clipboard text; agents without their own text-paste handler cannot paste with Super+V.

Apply the exception only to copy, and add a paste check to the new test.

@omarchybot omarchybot removed the enhancement New feature or request label Oct 15, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 4ff5368 against quattro, by reading the code; nothing was run on a worker, because the classification is unsettled (below). The second opinion was Codex Medium, which checked the same points separately and agreed with each.

The problem it fixes has gone. #13413 is closed, and the reporter's last comment there says Super+C works again in foot as of Codex 0.160.1. Codex now copies the way it did before, so this would add a Codex-specific exception for a bug Codex has already fixed.

It would break copy and paste in every agent window:

  • Super+V goes through the same universal_clipboard_shortcut as Super+C (default/hypr/bindings/clipboard.lua:62), so the new branch at line 50 also makes Super+V send Ctrl+V instead of Ctrl+Shift+V in org.omarchy.agent windows. The shipped terminal configs bind paste to Ctrl+Shift+V and Shift+Insert, not Ctrl+V, so paste stops working there. greptile's review comment points at the same thing.
  • org.omarchy.agent isn't just Codex. bin/omarchy-agent:165-167 gives that class to every agent it launches (Claude, opencode, openclaw and the rest), so in all of them Super+C would send Ctrl+C, which interrupts or exits the agent instead of copying the selection.
  • Codex started with omarchy agent --inline doesn't get that class (bin/omarchy-agent:162), so the exception misses that case anyway.

The new test only presses Super+C, so it catches none of these.

Classification: I read this as not-actionable, a workaround for a Codex bug Codex has since fixed. The second opinion read it as a bug fix. Because the two disagree, it carries no class label for now.

Next: this waits on the maintainer to decide whether to close it. If Codex breaks copy again, the fix would need to cover copy only, match Codex rather than every agent, and leave Super+V alone.

AnPod commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Closing since the linked issue #13413 was closed.

@AnPod AnPod closed this Oct 23, 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.

Codex CLI 0.157.1 breaks Super+C universal copy in its terminal UI

4 participants