Desktop app: copying a shell tool call removes its trailing quote

Open 💬 0 comments Opened Jul 29, 2026 by pranavanurag-getcrux

Issue

The copy button beside a shell tool call can remove the command's final single or double quote. The pasted command is then syntactically invalid and leaves shells such as zsh waiting at a quote> continuation prompt.

How to reproduce

  1. In the Codex desktop app, run a shell tool call whose command ends in a quoted argument, for example:
gcloud sql operations describe <operation-id> --project=<project-id> --format='value(status,endTime,error.errors.code,error.errors.message)'
  1. Click the copy icon beside the command.
  2. Paste it into a terminal.

Actual behavior

The copied command is missing its final quote:

gcloud sql operations describe <operation-id> --project=<project-id> --format='value(status,endTime,error.errors.code,error.errors.message)

zsh displays quote> because the single-quoted argument is unterminated.

Expected behavior

The clipboard text should exactly match the command Codex executed, including its closing quote.

Environment

  • Codex desktop: 26.721.30844 (bundle build 5813)
  • macOS
  • Shell: zsh

Investigation notes

I reproduced this against the installed desktop bundle. The shell tool-call component derives a normalized command and the copy handler writes that derived value to the clipboard:

navigator.clipboard.writeText(D)

The normalizer contains unconditional edge-quote removal:

.replace(/^['"]+/, "").replace(/['"]+$/, "")

For a command ending in --format='value(...)', this removes the closing quote even though it only closes an argument and does not wrap the complete command.

A minimal fix would be to copy the original raw command and reserve normalization for display. A regression test should cover commands ending in single- and double-quoted arguments.

View original on GitHub ↗