Files
codex/codex-rs/tui
Ian MacLeod fcbed044c8 Escape command drafts when recovering question answers (#49678)
## Why

When a turn ends, recovered question answers are appended to the composer draft. If that draft starts with a shell or slash command, submitting the combined text can interpret it as a command instead of a prompt.

## What changed

Escape command prefixes before appending recovered answers so the combined draft stays editable and submits as literal prompt text. Convert shell mode's separate `!` prefix into escaped composer text, and leave slash-prefixed paths such as `/tmp/file` unchanged.

Keep prefix escaping and answer recovery in the same Vim undo edit.

## Testing

Add regression coverage for immediate and queued submission, whitespace around command prefixes, slash-prefixed paths, and already escaped commands. Extend Vim undo coverage to shell and slash command drafts, including shell mode, and add a snapshot of the recovered shell draft.

GitOrigin-RevId: 03c40f72a834a65bf367103cb9170a86dc35ad98
2026-09-30 17:06:14 +00:00
..