Skip to content

Commit a4e2f54

Browse files
committed
more trimming
1 parent a7fe9cb commit a4e2f54

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

asyncgit/src/sync/hooks.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,15 @@ impl From<git2_hooks::HookResult> for HookResult {
2424
} => {
2525
const ANSI_CLEAR: &str = "\x1B[H\x1B[2J\x1B[3J";
2626

27-
let mut combined = format!("{stdout}{stderr}");
27+
let mut combined = stdout;
28+
29+
if let Some(trimmed) =
30+
combined.strip_suffix(ANSI_CLEAR)
31+
{
32+
combined.truncate(trimmed.len());
33+
}
34+
35+
combined.push_str(&stderr);
2836

2937
if let Some(trimmed) =
3038
combined.strip_suffix(ANSI_CLEAR)

0 commit comments

Comments
 (0)