Agents In Use
What’s new todayLast update
1005 additions

How to use Codex to remap terminal shortcuts

The ccc-morph author used Codex to build a PTY wrapper that remaps shortcuts per program, preventing a double Ctrl-D habit from closing Codex and the shell.

OUR ADAPTATION

Suggested prompt

Suggested prompt written by Agents In Use, not the source author. Replace bracketed inputs and review tool permissions first.

Research and build a PTY wrapper for [interactive CLI] that maps [key sequence] to [desired input] without closing the parent shell. Keep bindings per program, document platform support and demonstrate the failure and corrected behavior. Require explicit review of any command-triggering bindings.

What happened

ccc-morph repo released; demonstrated double-tap exiting only agent.

Reported by closetheloop-dev on Blog

How the agent did it

  1. Author identified double Ctrl-D habit closing both Codex and shell.
  2. Codex researched and built a PTY wrapper with per-program bindings.
  3. Added background commit action and error viewer.

Where a person stepped in

Author designed per-program mapping and demonstrated behavior.

The developer behind Close the Loop, Dev repeatedly closed their shell by using a shortcut learned in Claude Code. A double Ctrl-D exits Claude Code, but raw Codex exits after the first press; the second then reaches the shell. They asked Codex with GPT-5.6 Sol to research and build a fix.

The result, ccc-morph, wraps an interactive program in a pseudoterminal and applies configurable key mappings for that program. The author's demonstration shows the double-tap exiting Codex while preserving the shell. Because mappings are selected by the wrapped program, shortcuts can differ between Codex, Claude Code and other terminal tools.

The author also added a background commit-and-push binding using another Codex process. The example refuses to proceed when an existing staged change needs resolution and demonstrates stopping when a secrets file is staged. After that file is ignored, the demonstrated commit succeeds without leaving the main session.

The repository provides the wrapper and documents Linux and macOS support; Windows uses WSL rather than a native build. Any quota savings from the cheaper background model are not measured in the account.

Prompt
Suggested prompt (written by Agents In Use, not the author's)

Source: Blog · closetheloop-dev

Frequently asked questions

What problem did the wrapper solve?

A double Ctrl-D habit exited raw Codex and then closed the shell. The wrapper's demonstrated mapping exits only the agent.

Are mappings global across every tool?

They can be activated per wrapped program, letting the author use different bindings for Codex, Claude Code and other interactive tools.

What platform limit is documented?

The repository supports Linux and macOS; Windows can use WSL, but there is no native Windows build.

More details

About this account

Codex researched and built a per-program PTY wrapper and background command bindings; the author defined the desired shortcut behavior.

Primary first-person account opened and checked on 2026-10-14. Linux/macOS; native Windows unavailable (WSL works). Cost-saving from cheaper commit model is only a hope. Outcomes and test claims are attributed to the source and were not independently reproduced. Prompt is suggested by Agents In Use, not the author's quoted prompt.

Credit: closetheloop-dev on Blog

Source published 22 Jul 2026

Source checked 14 Oct 2026

Tools and topics

Codex · ccc-morph · Git · PTY

Terminal ergonomics · PTY wrapper · Keyboard shortcuts

Editorial completeness: 100/100. Measures documented fields, not agent performance or verified outcomes.