diff --git a/crates/client/Cargo.toml b/crates/client/Cargo.toml index 812c005..f4738a8 100644 --- a/crates/client/Cargo.toml +++ b/crates/client/Cargo.toml @@ -25,6 +25,7 @@ png = "0.17" futures-util = "0.3" colored = "2" terminal_size = "0.3" +unicode-width = "0.1" [build-dependencies] winres = "0.1" diff --git a/crates/client/src/display.rs b/crates/client/src/display.rs index c94d0cc..f7ffe5f 100644 --- a/crates/client/src/display.rs +++ b/crates/client/src/display.rs @@ -1,10 +1,22 @@ /// Terminal display helpers — table-style command rows with live spinner. /// /// Layout (no borders, aligned columns): -/// {2 spaces}{action_emoji}{2 spaces}{name: String { + let w = UnicodeWidthStr::width(s); + if w < 2 { + format!("{s} ") + } else { + s.to_string() + } +} // Fixed column widths (in terminal display columns, ASCII-only content assumed for name/payload/result) const NAME_W: usize = 14; @@ -52,12 +64,13 @@ fn format_row(action: &str, name: &str, payload: &str, status: &str, result: &st let (payload_w, result_w) = col_widths(); let p = trunc(payload, payload_w); let r = trunc(result, result_w); + // emoji_cell ensures every action/status occupies exactly 2 terminal columns format!( " {} {: