From ef4ca0ccbb8b59835b9e90ae5711f42d783bbbe4 Mon Sep 17 00:00:00 2001 From: Helios Agent Date: Tue, 3 Mar 2026 15:06:30 +0100 Subject: [PATCH] fix(client): truncate long commands and output in log lines (max 60 chars) --- crates/client/src/main.rs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/crates/client/src/main.rs b/crates/client/src/main.rs index bdc5628..3b5adee 100644 --- a/crates/client/src/main.rs +++ b/crates/client/src/main.rs @@ -320,15 +320,26 @@ async fn handle_message( } ServerMessage::ExecRequest { request_id, command } => { - log_cmd!("exec › {}", command); + // Truncate long commands for display + let cmd_display = if command.len() > 60 { + format!("{}…", &command[..60]) + } else { + command.clone() + }; + log_cmd!("exec › {}", cmd_display); let mut sh = shell.lock().await; match sh.run(&command).await { Ok((stdout, stderr, exit_code)) => { let out = stdout.trim().lines().next().unwrap_or("").to_string(); - if out.is_empty() { - log_ok!("Done {} exit {}", "·".dimmed(), exit_code); + let out_display = if out.len() > 60 { + format!("{}…", &out[..60]) } else { - log_ok!("{} {} exit {}", out, "·".dimmed(), exit_code); + out + }; + if out_display.is_empty() { + log_ok!("exit {}", exit_code); + } else { + log_ok!("{} {} exit {}", out_display, "·".dimmed(), exit_code); } let _ = stderr; ClientMessage::ExecResponse {