Codex CLI 0.142.5 completely unusable in Ghostty 1.3.1 — kitty keyboard protocol and OSC responses leak as literal text
Resolved 💬 3 comments Opened Jul 2, 2026 by bign0name Closed Jul 3, 2026
What version of Codex CLI is running?
codex-cli 0.142.5
What subscription do you have?
Plus
Which model were you using?
_No response_
What platform is your computer?
macOS | Darwin 24.6.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
Ghostty, tmux 3.7b
Codex doctor report
billgatis@MacBook-Air ~ % codex doctor --json
{
"schemaVersion": 1,
"generatedAt": "1783032965s since unix epoch",
"overallStatus": "ok",
"codexVersion": "0.142.5",
"checks": {
"app_server.status": {
"id": "app_server.status",
"category": "app-server",
"status": "ok",
"summary": "background server is not running",
"details": {
"control socket": "/Users/peter/.codex/app-server-control/app-server-control.sock",
"daemon state dir": "/Users/peter/.codex/app-server-daemon",
"mode": "ephemeral",
"pid file": "/Users/peter/.codex/app-server-daemon/app-server.pid (missing)",
"settings": "/Users/peter/.codex/app-server-daemon/settings.json (missing)",
"status": "not running",
"update-loop pid file": "/Users/peter/.codex/app-server-daemon/app-server-updater.pid (missing)"
},
"remediation": null,
"durationMs": 0
},
"auth.credentials": {
"id": "auth.credentials",
"category": "auth",
"status": "ok",
"summary": "auth is configured",
"details": {
"auth file": "/Users/peter/.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": "/Users/peter/.codex",
"config.toml": "/Users/peter/.codex/config.toml",
"config.toml parse": "ok",
"cwd": "/Users/peter",
"enabled feature flags": "shell_tool, unified_exec, shell_snapshot, terminal_resize_reflow, sqlite, hooks, enable_request_compression, multi_agent, apps, tool_search_always_defer_mcp_tools, tool_suggest, plugins, in_app_browser, browser_use, browser_use_full_cdp_access, browser_use_external, computer_use, plugin_sharing, image_generation, resize_all_images, skill_mcp_dependency_install, mentions_v2, steer, guardian_approval, goals, collaboration_modes, tool_call_mcp_elicitation, personality, fast_mode, tui_app_server, auto_compaction, remote_compaction_v2, workspace_dependencies",
"feature flag overrides": "none",
"feature flags enabled": "33",
"log dir": "/Users/peter/.codex/log",
"mcp servers": "0",
"model": "gpt-5.5",
"model provider": "openai",
"sqlite home": "/Users/peter/.codex"
},
"remediation": null,
"durationMs": 0
},
"git.environment": {
"id": "git.environment",
"category": "git",
"status": "ok",
"summary": "git version 2.50.1 (Apple Git-155)",
"details": {
"PATH git #1": "/usr/bin/git",
"PATH git entries": "1",
"git build options": "git version 2.50.1 (Apple Git-155); cpu: arm64; no commit associated with this build; sizeof-long: 8; sizeof-size_t: 8; shell-path: /bin/sh; feature: fsmonitor--daemon; libcurl: 8.7.1; zlib: 1.2.12; SHA-1: SHA1_DC; SHA-256: SHA256_BLK",
"git exec path": "/Library/Developer/CommandLineTools/usr/libexec/git-core",
"git version": "git version 2.50.1 (Apple Git-155)",
"repo detected": "false",
"selected git": "/usr/bin/git"
},
"remediation": null,
"durationMs": 43
},
"installation": {
"id": "installation",
"category": "install",
"status": "ok",
"summary": "installation looks consistent",
"details": {
"PATH codex #1": "/opt/homebrew/bin/codex",
"current executable": "/opt/homebrew/bin/codex",
"install context": "brew",
"managed by bun": "false",
"managed by npm": "false",
"managed package root": "not set"
},
"remediation": null,
"durationMs": 4
},
"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 403)",
"reachability mode": "ChatGPT auth"
},
"remediation": null,
"durationMs": 267
},
"network.websocket_reachability": {
"id": "network.websocket_reachability",
"category": "websocket",
"status": "ok",
"summary": "Responses WebSocket handshake succeeded",
"details": {
"DNS": "2 IPv4, 2 IPv6, first IPv6",
"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": 801
},
"runtime.provenance": {
"id": "runtime.provenance",
"category": "runtime",
"status": "ok",
"summary": "running brew on macos-aarch64",
"details": {
"commit": "unknown",
"current executable": "/opt/homebrew/bin/codex",
"install method": "brew",
"platform": "macos-aarch64",
"version": "0.142.5"
},
"remediation": null,
"durationMs": 0
},
"runtime.search": {
"id": "runtime.search",
"category": "search",
"status": "ok",
"summary": "search is OK (system)",
"details": {
"search command": "rg",
"search command readiness": "ripgrep 15.1.0",
"search provider": "system"
},
"remediation": null,
"durationMs": 9
},
"sandbox.helpers": {
"id": "sandbox.helpers",
"category": "sandbox",
"status": "ok",
"summary": "sandbox configuration is readable",
"details": {
"approval policy": "OnRequest",
"codex-linux-sandbox helper": "none",
"execve wrapper helper": "/Users/peter/.codex/tmp/arg0/codex-arg0N6kke3/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": "/Users/peter/.codex (dir)",
"active rollout files": "33 files, 20837497 total bytes, 631439 average bytes",
"archived rollout files": "0 files, 0 total bytes, 0 average bytes",
"goals DB": "/Users/peter/.codex/goals_1.sqlite (file)",
"goals DB integrity": "ok",
"log DB": "/Users/peter/.codex/logs_2.sqlite (file)",
"log DB integrity": "ok",
"log dir": "/Users/peter/.codex/log (missing)",
"memories DB": "/Users/peter/.codex/memories_1.sqlite (file)",
"memories DB integrity": "ok",
"sqlite home": "/Users/peter/.codex (dir)",
"state DB": "/Users/peter/.codex/state_5.sqlite (file)",
"state DB integrity": "ok"
},
"remediation": null,
"durationMs": 3637
},
"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": "33",
"rollout DB active rows": "33",
"rollout DB archive mismatches": "0",
"rollout DB archived files": "0",
"rollout DB archived rows": "0",
"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=33",
"rollout DB rows": "33",
"rollout DB scan cap reached": "false",
"rollout DB scan errors": "0",
"rollout DB sources": "cli=33",
"rollout DB stale rows": "0"
},
"remediation": null,
"durationMs": 367
},
"system.environment": {
"id": "system.environment",
"category": "system",
"status": "ok",
"summary": "OS language en-US",
"details": {
"EDITOR": "set",
"LANG": "en_CA.UTF-8",
"VISUAL": "set",
"os": "Mac OS 15.7.4 [64-bit]",
"os language": "en-US",
"os type": "Mac OS",
"os version": "15.7.4"
},
"remediation": null,
"durationMs": 5
},
"terminal.env": {
"id": "terminal.env",
"category": "terminal",
"status": "ok",
"summary": "terminal metadata was detected",
"details": {
"COLORTERM": "truecolor",
"TERM": "xterm-ghostty",
"TERM_PROGRAM": "ghostty",
"color output": "enabled",
"effective locale": "en_CA.UTF-8",
"multiplexer": "tmux 3.7b",
"stderr is terminal": "true",
"stdin is terminal": "true",
"stdout is terminal": "true",
"terminal": "Ghostty",
"terminal size": "219x100",
"terminal version": "1.3.1",
"tmux allow-passthrough": "on",
"tmux client termname": "xterm-ghostty",
"tmux client termtype": "ghostty 1.3.1",
"tmux extended-keys": "off",
"tmux focus-events": "on",
"tmux set-clipboard": "on",
"tmux xterm-keys": "on"
},
"remediation": null,
"durationMs": 38
},
"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": "cwd",
"terminal title project value": "peter",
"terminal title source": "default"
},
"remediation": null,
"durationMs": 0
},
"updates.status": {
"id": "updates.status",
"category": "updates",
"status": "ok",
"summary": "update configuration is locally consistent",
"details": {
"cached latest version": "0.142.5",
"check for update on startup": "true",
"last checked at": "2026-07-02T18:46:12.835466Z",
"latest version": "0.142.5",
"latest version status": "current version is not older",
"update action": "brew upgrade --cask codex",
"version cache": "/Users/peter/.codex/version.json"
},
"remediation": null,
"durationMs": 122
}
}
}
What issue are you seeing?
- Codex 0.142.5, Ghostty 1.3.1, macOS arm64, tmux 3.7b (also broken outside tmux)
- Every keypress shows raw CSI u sequences (e.g.
[99;5ufor Ctrl+C,[100;1:3ufor 'd') - OSC 10/11 color query responses leak as visible text (
]10;rgb:f5f5/f5f5/f5f5) - Focus events leak (
[I,[O) - App is completely unusable — can't type, can't exit
- Gemini CLI, Claude Code, nvim, yazi all work perfectly in the same Ghostty + tmux setup
TERM_PROGRAM="" codexdoesn't help- Started after brew upgrade; only 0.142.5 is cached so can't test older versions
What steps can reproduce the bug?
- Open Ghostty 1.3.1 on macOS
- Run
codex - Try typing anything — keypresses show as raw
[100;1:3usequences - Try Ctrl+C to exit — shows
[99;5uas literal text in the input prompt instead of exiting - Alt-tab away from Ghostty and back —
[I,[O, and]10;rgb:...leak as visible text - App is completely unresponsive — cannot type, cannot exit, cannot Ctrl+C. The only way to close is force-quitting the terminal or killing the process from another window
https://github.com/user-attachments/assets/363f5f0e-4445-433a-90e6-527db574ce15
What is the expected behavior?
_No response_
Additional information
_No response_
3 Comments
Also, suspending codex-cli 0.142.5 (with Ctrl-Z) in kitty 0.32.2 leaves the terminal completely unusable.
Resolved — root cause was my ~/.gitconfig rewriting all HTTPS GitHub URLs to SSH:
This forced Codex to use SSH for git operations, which fails silently in the sandboxed environment since it can't access SSH keys or respond to passphrase prompts. The broken git auth cascaded into the terminal rendering issues I was seeing.
Fix: remove the
insteadOfrule, or usepushInsteadOfto only rewrite pushes while keeping HTTPS for pulls/fetches. Then rungh auth login(HTTPS) for private repo access.Hope this helps anyone else hitting mysterious Codex breakage after a macOS restart.
Related Ghostty/Crossterm palette and input-path investigation: https://github.com/openai/codex/issues/24527. It confirms synchronous focus-time OSC foreground/background queries as one blocking path and separately measures stdin-readiness-to-event delivery. The literal escape-sequence leakage fixed here is a different failure mode, but both reports exercise the same palette-query/input ownership boundary.