Story 7.6: Starship-compatible format field (#56)#63
Conversation
…ed spans (#56) Add `format` field to CshipConfig supporting Starship-style format strings with `$line_break` for multi-row output and `[content](style)` ANSI spans. Fix parse_line to scan for both `[` and `$` simultaneously, preventing styled spans after literal text from being silently eaten as plain text. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code reviewBug: File: When let after_dollar = &remaining[1..];
let name_end = after_dollar
.find(char::is_whitespace)
.unwrap_or(after_dollar.len());
let name = &after_dollar[..name_end];Because This inconsistency is introduced by this PR: before it, The existing tests all place a space between a token and a span (e.g. Suggested fix: let name_end = after_dollar
.find(|c: char| c.is_whitespace() || c == '[')
.unwrap_or(after_dollar.len());🤖 Generated with Claude Code |
…led spans Without this, $cship.model[sep](fg:red) (no space) would consume the entire [sep](fg:red) as part of the token name, silently dropping the styled span. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
formatfield toCshipConfigsupporting Starship-style format strings with$line_breakfor multi-row output and[content](style)ANSI styled spansparse_lineto scan for both[and$simultaneously, preventing styled spans after literal text from being silently consumed as plain text$fillas empty with one-shot warning,$line_breaksplitting at therender()level, andformatpriority overlineswithtracing::warn!Closes #56
Test plan
cargo clippy -- -D warningscleancargo fmt --checkcleancargo test— 324 total (259 unit + 65 integration), 0 failures$line_breaksplit, format priority, lines backwards compat,$fillempty, integration format+line_break🤖 Generated with Claude Code