[BUG] /rename consumes following newline and slash command as part of the name argument
Version
Claude Code 2.1.142
Repro
In an interactive session, submit this as a single message (with a real newline between the two lines):
/rename heredoc-archeology
/color orange
Expected
/renametakesheredoc-archeologyas the new session name (terminating at the newline)./color orangeis dispatched as a second slash command.
Actual
- The session is renamed to the literal string
heredoc-archeology\n/color orange(newline and second command included in the name). - The
/colorcommand is never dispatched.
Confirmed via the echoed Session renamed to: … line, which contains the trailing /color … text on a second line.
Impact
Pasting or typing multi-command sequences silently corrupts the first argument. The user has no indication the second command was swallowed.
Suggested fix
Slash command argument parsing should terminate the argument at the first newline (matching shell/CLI conventions). A trailing slash-command line should be re-dispatched as its own command, or at minimum rejected with an error rather than silently appended.
Related
- #56899 —
/effort <level>on first line of multiline message (different command, related parsing surface).
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗