mirror of
https://github.com/openai/codex.git
synced 2026-05-02 02:17:22 +00:00
## Why The TUI currently handles keyboard shortcuts as hard-coded event matches spread across app, composer, pager, list, approval, and navigation code. That makes shortcuts hard to customize, makes displayed hints easy to drift from actual behavior, and makes future keymap work riskier because there is no central action inventory. This PR adds the foundation for configurable, action-based keymaps without adding the interactive remapping UI yet. Onboarding intentionally stays on fixed startup shortcuts because users cannot reasonably configure keymaps before completing onboarding. This is PR1 in the keymap stack: - PR1: #18593: configurable keymap foundation - PR2: #18594: `/keymap` picker and guided remapping UI - PR3: #18595: Vim composer mode and the remap option ## Design Notes The new model resolves named actions into concrete runtime bindings once from config, then passes those bindings to the UI surfaces that handle input or render shortcut hints. The main concepts are: - **Context**: a scope where an action is active, such as `global`, `chat`, `composer`, `editor`, `pager`, `list`, or `approval`. - **Action**: a named operation inside a context, such as `global.open_transcript`, `composer.submit`, or `pager.close`. - **Binding**: one or more single-key shortcuts assigned to an action, written as config strings such as `ctrl-t`, `alt-backspace`, or `page-down`. Multi-step sequences such as `ctrl-x ctrl-s`, `g g`, or leader-key flows are not part of this PR. - **Resolution order**: context-specific config wins first, supported global fallbacks come next, and built-in defaults fill in anything unset. - **Explicit unbinding**: an empty array removes an action binding in that scope and does not fall through to a fallback binding. - **Conflict validation**: a resolved keymap rejects duplicate active bindings inside the same scope so one keypress cannot dispatch two actions. ## What Changed - Added `TuiKeymap` config support under `[tui.keymap]`, including typed contexts/actions, key alias normalization, generated schema coverage, and user-facing config errors. - Added `RuntimeKeymap` resolution in `codex-rs/tui/src/keymap.rs`, including fallback precedence, built-in defaults, explicit unbinding, and per-context conflict validation. - Rewired existing TUI handlers to consume resolved keymap actions instead of directly matching hard-coded keys in each component. - Updated key hint rendering and footer/pager/list surfaces so displayed shortcuts follow the resolved keymap. - Kept onboarding shortcuts fixed in `codex-rs/tui/src/onboarding/keys.rs` instead of exposing them through `[tui.keymap]`. ## Validation The branch includes focused coverage for config parsing, key normalization, runtime fallback resolution, explicit unbinding, duplicate-key conflict validation, default keymap consistency, onboarding startup key behavior, and UI hint snapshots affected by resolved key bindings.
29 lines
1.9 KiB
Plaintext
29 lines
1.9 KiB
Plaintext
Use /compact when the conversation gets long to summarize history and free up context.
|
|
Start a fresh idea with /new; the previous session stays in history.
|
|
Use /feedback to send logs to the maintainers when something looks off.
|
|
Switch models or reasoning effort quickly with /model.
|
|
Use /permissions to control when Codex asks for confirmation.
|
|
Run /review to get a code review of your current changes.
|
|
Use /skills to list available skills or ask Codex to use one.
|
|
Use /status to see the current model, approvals, and token usage.
|
|
Use /statusline to configure which items appear in the status line.
|
|
Use /fork to branch the current chat into a new thread.
|
|
Use /side to start a side conversation in a temporary fork without polluting the main thread.
|
|
Use /init to create an AGENTS.md with project-specific guidance.
|
|
Use /mcp to list configured MCP tools.
|
|
Run `codex app` to open Codex Desktop (it installs on macOS if needed).
|
|
Use /personality to customize how Codex communicates.
|
|
Use /rename to rename your threads for easier thread resuming.
|
|
Use the OpenAI docs MCP for API questions; enable it with `codex mcp add openaiDeveloperDocs --url https://developers.openai.com/mcp`.
|
|
Join the OpenAI community Discord: http://discord.gg/openai
|
|
Visit the Codex community forum: https://community.openai.com/c/codex/37
|
|
You can run any shell command from Codex using `!` (e.g. `!ls`)
|
|
Type / to open the command popup; Tab autocompletes slash commands.
|
|
When the composer is empty, press Esc to step back and edit your last message; Enter confirms.
|
|
Press Tab to queue a message when a task is running; otherwise it sends immediately (except `!`).
|
|
[tui.keymap] in ~/.codex/config.toml lets you rebind supported shortcuts.
|
|
See the Codex keymap documentation for supported actions and examples.
|
|
Paste an image with Ctrl+V to attach it to your next message.
|
|
You can resume a previous conversation by running `codex resume`
|
|
Use /copy or press Ctrl+O to copy the latest agent response as Markdown.
|