Conversation
Detect and flatten Claude Code terminal prompts that include decoration (❯ prefix, ─── rules, duplicate content) or terminal line wrapping. Four scenarios handled: full decoration, raw slash commands, ❯-only prefix, and terminal-wrapped text. Configurable via Settings > General. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 84bc1d7b74
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if self.isLikelySourceCode(text) { return nil } | ||
| // Not a list | ||
| if self.isLikelyList(lines) { return nil } | ||
|
|
||
| let result = self.flattenWrappedLines(nonEmptyLines.map { String($0) }) |
There was a problem hiding this comment.
Avoid flattening Python-style code as wrapped text
In stripClaudeCodeDecoration's terminal-wrap fallback, any multi-line text with indented continuation lines is flattened unless isLikelySourceCode rejects it, but that helper only recognizes code when braces/begin are present. As a result, common brace-less snippets such as if ready:\n run() (or YAML-like blocks) satisfy this branch and are collapsed into a single line, silently corrupting copied code when flattenClaudeCodePrompts is enabled (default-on).
Useful? React with 👍 / 👎.
Summary
\"when the terminal wraps copied slash commands in quotesquotePathWithSpacesnot recognizing--long-flagsor slash commandsFive copy scenarios handled
❯ /cmd "args"\n───\n/cmd "args"\n --flag/cmd "args" --flag❯ /commit/commit/skill:cmd "args\n wrapped" --flag/skill:cmd "args wrapped" --flagLong prompt that got\n wrapped by terminal"/cmd \"args\" --flag"/cmd "args" --flagTest plan
ClaudeCodePromptTests.swift— all scenarios + negatives + pipeline integration🤖 Generated with Claude Code