mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-07 08:27:12 +00:00
Collapse whitespace in ProgressUI tool call display to prevent line breaks
Multi-line arguments (e.g. spawn_agent task descriptions) were breaking the single-line progress output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
28b5d485c1
commit
5fd4a5ea2e
1 changed files with 4 additions and 3 deletions
|
|
@ -92,12 +92,13 @@ fn format_number(n: f64) -> String {
|
|||
// ── Tool call display name ──────────────────────────────────────────────
|
||||
|
||||
fn truncate(s: &str, max: usize) -> String {
|
||||
if s.len() > max {
|
||||
let mut t: String = s.chars().take(max - 3).collect();
|
||||
let single_line: String = s.split_whitespace().collect::<Vec<_>>().join(" ");
|
||||
if single_line.len() > max {
|
||||
let mut t: String = single_line.chars().take(max - 3).collect();
|
||||
t.push_str("...");
|
||||
t
|
||||
} else {
|
||||
s.to_string()
|
||||
single_line
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue