Ctrl-c Ambiguous Actions Cause Data Loss
Open 💬 1 comment Opened Aug 11, 2026 by johnaweiss
What version of Codex CLI is running?
codex-cli 0.147.0
What subscription do you have?
Plus
Which model were you using?
Luna various
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What terminal emulator and version are you using (if applicable)?
Windows Terminal (WSL / PowerShell)
Codex doctor report
$ codex doctor --json
{
"schemaVersion": 1,
"generatedAt": "1786473163s since unix epoch",
"overallStatus": "ok",
"codexVersion": "0.147.0",
"checks": {
"app_server.status": {
"id": "app_server.status",
"category": "app-server",
"status": "ok",
"summary": "background server is not running",
"details": {
"control socket": "/home/devuser/.codex/app-server-control/app-server-control.sock",
"daemon state dir": "/home/devuser/.codex/app-server-daemon",
"mode": "persistent",
"pid file": "/home/devuser/.codex/app-server-daemon/app-server.pid (missing)",
"settings": "/home/devuser/.codex/app-server-daemon/settings.json (file)",
"status": "not running",
"update-loop pid file": "/home/devuser/.codex/app-server-daemon/app-server-updater.pid (file)"
},
"remediation": null,
"durationMs": 0
},
"auth.credentials": {
"id": "auth.credentials",
"category": "auth",
"status": "ok",
"summary": "auth is configured",
"details": {
"auth file": "/home/devuser/.codex/auth.json",
"auth storage mode": "File",
"stored API key": "false",
"stored ChatGPT tokens": "true",
"stored agent identity": "false",
"stored auth mode": "chatgpt"
},
"remediation": null,
"durationMs": 0
},
"config.load": {
"id": "config.load",
"category": "config",
"status": "ok",
"summary": "config loaded",
"details": {
"CODEX_HOME": "/home/devuser/.codex",
"config.toml": "/home/devuser/.codex/config.toml",
"config.toml parse": "ok",
"cwd": "/mnt/c/Users/Naj/git/ipc_broker",
"enabled feature flags": "shell_tool, view_image, unified_exec, shell_snapshot, code_mode_host, terminal_resize_reflow, sqlite, hooks, enable_request_compression, multi_agent, apps, tool_search_always_defer_mcp_tools, tool_suggest, plugins, in_app_browser, in_app_updates, browser_use, browser_use_full_cdp_access, browser_use_external, computer_use, remote_plugin, plugin_sharing, image_generation, resize_all_images, item_ids, skill_mcp_dependency_install, skill_search, mentions_v2, steer, guardian_approval, goals, collaboration_modes, tool_call_mcp_elicitation, auth_elicitation, personality, fast_mode, tui_app_server, remote_compaction_v2, workspace_dependencies",
"feature flag overrides": "none",
"feature flags enabled": "39",
"log dir": "/home/devuser/.codex/log",
"mcp servers": "0",
"model": "gpt-5.6-luna",
"model provider": "openai",
"sqlite home": "/home/devuser/.codex"
},
"remediation": null,
"durationMs": 0
},
"git.environment": {
"id": "git.environment",
"category": "git",
"status": "ok",
"summary": "git version 2.55.0",
"details": {
".git entry": "directory",
"PATH git #1": "/usr/sbin/git",
"PATH git #2": "/usr/bin/git",
"PATH git #3": "/sbin/git",
"PATH git #4": "/bin/git",
"PATH git entries": "4",
"git branch": "master",
"git build options": "git version 2.55.0; cpu: x86_64; built from commit: e9019fcafe0040228b8631c30f97ae1adb61bcdc; sizeof-long: 8; sizeof-size_t: 8; shell-path: /bin/sh; rust: enabled; feature: fsmonitor--daemon; gettext: enabled; libcurl: 8.21.0; OpenSSL: OpenSSL 3.6.3 9 Jun 2026; zlib-ng: 2.3.3; SHA-1: SHA1_DC; SHA-256: SHA256_BLK; default-ref-format: files; default-hash: sha1",
"git exec path": "/usr/lib/git-core",
"git version": "git version 2.55.0",
"repo detected": "true",
"repo root": "/mnt/c/Users/Naj/git/ipc_broker",
"selected git": "/usr/sbin/git"
},
"remediation": null,
"durationMs": 199
},
"installation": {
"id": "installation",
"category": "install",
"status": "ok",
"summary": "installation looks consistent",
"details": {
"PATH codex #1": "/home/devuser/.local/bin/codex",
"PATH codex #2": "/usr/sbin/codex",
"PATH codex #3": "/usr/bin/codex",
"PATH codex #4": "/sbin/codex",
"PATH codex #5": "/bin/codex",
"PATH codex entries": "5",
"current executable": "/home/devuser/.codex/packages/standalone/releases/0.147.0-x86_64-unknown-linux-musl/bin/codex",
"install context": "standalone (unix, package /home/devuser/.codex/packages/standalone/releases/0.147.0-x86_64-unknown-linux-musl, bin /home/devuser/.codex/packages/standalone/releases/0.147.0-x86_64-unknown-linux-musl/bin, resources /home/devuser/.codex/packages/standalone/releases/0.147.0-x86_64-unknown-linux-musl/codex-resources, path /home/devuser/.codex/packages/standalone/releases/0.147.0-x86_64-unknown-linux-musl/codex-path)",
"managed by bun": "false",
"managed by npm": "false",
"managed by pnpm": "false",
"managed package root": "not set"
},
"remediation": null,
"durationMs": 25
},
"mcp.config": {
"id": "mcp.config",
"category": "mcp",
"status": "ok",
"summary": "no MCP servers configured",
"details": {},
"remediation": null,
"durationMs": 0
},
"network.env": {
"id": "network.env",
"category": "network",
"status": "ok",
"summary": "network-related environment looks readable",
"details": {
"proxy env vars": "none"
},
"remediation": null,
"durationMs": 0
},
"network.provider_reachability": {
"id": "network.provider_reachability",
"category": "reachability",
"status": "ok",
"summary": "active provider endpoints are reachable over HTTP",
"details": {
"ChatGPT base URL": "https://chatgpt.com/backend-api/ reachable (HTTP 404)",
"reachability mode": "ChatGPT auth"
},
"remediation": null,
"durationMs": 332
},
"network.websocket_reachability": {
"id": "network.websocket_reachability",
"category": "websocket",
"status": "ok",
"summary": "Responses WebSocket handshake succeeded",
"details": {
"DNS": "2 IPv4, 2 IPv6, first IPv4",
"auth mode": "chatgpt",
"connect timeout": "15000 ms",
"endpoint": "wss://chatgpt.com/backend-api/<redacted>",
"handshake result": "HTTP 101 Switching Protocols",
"model provider": "openai",
"models etag present": "true",
"provider name": "OpenAI",
"proxy env vars": "none",
"reasoning header": "false",
"server model present": "false",
"supports websockets": "true",
"wire API": "responses"
},
"remediation": null,
"durationMs": 792
},
"runtime.provenance": {
"id": "runtime.provenance",
"category": "runtime",
"status": "ok",
"summary": "running standalone on linux-x86_64",
"details": {
"commit": "unknown",
"current executable": "/home/devuser/.codex/packages/standalone/releases/0.147.0-x86_64-unknown-linux-musl/bin/codex",
"install method": "standalone (unix, package /home/devuser/.codex/packages/standalone/releases/0.147.0-x86_64-unknown-linux-musl, bin /home/devuser/.codex/packages/standalone/releases/0.147.0-x86_64-unknown-linux-musl/bin, resources /home/devuser/.codex/packages/standalone/releases/0.147.0-x86_64-unknown-linux-musl/codex-resources, path /home/devuser/.codex/packages/standalone/releases/0.147.0-x86_64-unknown-linux-musl/codex-path)",
"platform": "linux-x86_64",
"version": "0.147.0"
},
"remediation": null,
"durationMs": 0
},
"runtime.search": {
"id": "runtime.search",
"category": "search",
"status": "ok",
"summary": "search is OK (bundled)",
"details": {
"search command": "/home/devuser/.codex/packages/standalone/releases/0.147.0-x86_64-unknown-linux-musl/codex-path/rg",
"search command readiness": "file exists",
"search provider": "bundled"
},
"remediation": null,
"durationMs": 0
},
"sandbox.helpers": {
"id": "sandbox.helpers",
"category": "sandbox",
"status": "ok",
"summary": "sandbox configuration is readable",
"details": {
"approval policy": "OnRequest",
"codex-linux-sandbox helper": "/home/devuser/.codex/tmp/arg0/codex-arg05nx3Fq/codex-linux-sandbox",
"execve wrapper helper": "/home/devuser/.codex/tmp/arg0/codex-arg05nx3Fq/codex-execve-wrapper",
"filesystem sandbox": "restricted",
"network sandbox": "restricted"
},
"remediation": null,
"durationMs": 0
},
"state.paths": {
"id": "state.paths",
"category": "state",
"status": "ok",
"summary": "state paths and databases are inspectable",
"details": {
"CODEX_HOME": "/home/devuser/.codex (dir)",
"active rollout files": "61 files, 185471423 total bytes, 3040515 average bytes",
"archived rollout files": "1 files, 28150 total bytes, 28150 average bytes",
"goals DB": "/home/devuser/.codex/goals_1.sqlite (file)",
"goals DB integrity": "ok",
"log DB": "/home/devuser/.codex/logs_2.sqlite (file)",
"log DB integrity": "ok",
"log dir": "/home/devuser/.codex/log (missing)",
"memories DB": "/home/devuser/.codex/memories_1.sqlite (file)",
"memories DB integrity": "ok",
"queue DB": "/home/devuser/.codex/queue_1.sqlite (file)",
"queue DB integrity": "ok",
"sqlite home": "/home/devuser/.codex (dir)",
"standalone release cache": "3 entries in /home/devuser/.codex/packages/standalone/releases",
"state DB": "/home/devuser/.codex/state_5.sqlite (file)",
"state DB integrity": "ok",
"thread history DB": "/home/devuser/.codex/thread_history_1.sqlite (file)",
"thread history DB integrity": "ok"
},
"remediation": null,
"durationMs": 3167
},
"state.rollout_db_parity": {
"id": "state.rollout_db_parity",
"category": "threads",
"status": "ok",
"summary": "rollout files and state DB thread inventory agree",
"details": {
"default model provider": "openai",
"rollout DB active files": "61",
"rollout DB active rows": "61",
"rollout DB archive mismatches": "0",
"rollout DB archived files": "1",
"rollout DB archived rows": "1",
"rollout DB duplicate DB paths": "0",
"rollout DB duplicate rollout thread ids": "0",
"rollout DB malformed file names": "0",
"rollout DB missing active rows": "0",
"rollout DB missing archived rows": "0",
"rollout DB model providers": "openai=62",
"rollout DB rows": "62",
"rollout DB scan cap reached": "false",
"rollout DB scan errors": "0",
"rollout DB sources": "vscode=42, cli=17, subagent:other=3",
"rollout DB stale rows": "0"
},
"remediation": null,
"durationMs": 264
},
"system.environment": {
"id": "system.environment",
"category": "system",
"status": "ok",
"summary": "OS language C",
"details": {
"EDITOR": "not set",
"LANG": "C.UTF-8",
"VISUAL": "not set",
"os": "Arch Linux [64-bit]",
"os language": "C",
"os type": "Arch Linux",
"os version": "Unknown"
},
"remediation": null,
"durationMs": 18
},
"terminal.env": {
"id": "terminal.env",
"category": "terminal",
"status": "ok",
"summary": "terminal metadata was detected",
"details": {
"DISPLAY": "present",
"WAYLAND_DISPLAY": "present",
"WSL_DISTRO_NAME": "present",
"WSL_INTEROP": "present",
"WT_SESSION": "present",
"color output": "enabled",
"effective locale": "C.UTF-8",
"stderr is terminal": "true",
"stdin is terminal": "true",
"stdout is terminal": "true",
"terminal": "Windows Terminal",
"terminal size": "133x35"
},
"remediation": null,
"durationMs": 1
},
"terminal.title": {
"id": "terminal.title",
"category": "title",
"status": "ok",
"summary": "terminal title default",
"details": {
"terminal title activity": "true",
"terminal title items": "activity, project-name",
"terminal title project source": "git repo root",
"terminal title project value": "ipc_broker",
"terminal title source": "default"
},
"remediation": null,
"durationMs": 2
},
"updates.status": {
"id": "updates.status",
"category": "updates",
"status": "ok",
"summary": "update configuration is locally consistent",
"details": {
"cached latest version": "0.147.0",
"check for update on startup": "true",
"last checked at": "2026-08-10T18:44:28.984212613Z",
"latest version": "0.147.0",
"latest version status": "current version is not older",
"update action": "standalone installer",
"version cache": "/home/devuser/.codex/version.json"
},
"remediation": null,
"durationMs": 620
}
}
}
What issue are you seeing?
Ctrl-c has conflicting actions:
- clear query box from insertion-point to end
- quit codex
As a result, i'm repeatedly quitting codex when i only meant to clear the query box from insertion-point to end. This causes lost work.
What steps can reproduce the bug?
- enter a query.
- place insertion point midway through text.
- do Ctrl-c
- do Ctrl-c again
- do Ctrl-c once more
What is the expected behavior?
- clear query box from insertion-point to end
- do NOT quit codex
Additional information
clearing query from insertion-point to end vs quitting codex are TWO VERY DIFFERENT ACTIONS, and too easy to quit by accident, causing lost work.
there should be separate keystrokes for each action
1 Comment
Confirmed the exact hazard on
main@ 1f41cc5d92, inon_ctrl_c(tui/src/chatwidget/interaction.rs#L401-L455): when the composer consumes Ctrl-C as an editing action (bottom_pane.on_ctrl_c() == Handled— your clear-to-end), the handler still arms the double-press quit shortcut (#L412-L418, no modal active →arm_quit_shortcut). So press 1 edits text and arms quit; press 2 within the window hitsquit_shortcut_active_for→request_quit_without_confirmation(#L443-L448). Two intentional edits in quick succession = quit with work lost — your 3-press repro exactly.The codebase already has the right rule one key over: the Ctrl-D handler's doc states it "only participates in quit when the composer is empty and no modal/popup is active" (#L459). Applying the same gate to Ctrl-C — don't arm quit when the press had an editing effect / the composer is non-empty — removes the ambiguity without changing quit behavior for the empty-composer case people actually use to exit. One condition around the
arm_quit_shortcutcall in theHandledbranch.