Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

fix(help): drop the stray trailing space from the --help aliases list (#2689)

Maximilian Roos547092aa6f6f
diff --git a/src/commands/alias.rs b/src/commands/alias.rs
index afd9fb5c9..9f0c88c29 100644
--- a/src/commands/alias.rs
+++ b/src/commands/alias.rs
@@ -764,7 +764,7 @@ fn render_aliases_help_section(
// `cformat!`'s `</>` emits `\e[39m`, which the markdown pass over this
// output (`wrap_styled_text`) strips — leaving the fg color dangling onto
- // whatever follows. Terminate each name with a full reset (`\e[0m`, which
+ // the following text. Terminate each name with a full reset (`\e[0m`, which
// survives that pass) so the comma separators render uncolored, matching
// how clap closes each `Commands:` entry.
let reset = anstyle::Reset;
@@ -783,12 +783,9 @@ fn render_aliases_help_section(
let mut out = String::new();
let _ = writeln!(out, "{}", cformat!("<bold><green>Aliases:</></>"));
- // Trailing space after the list: `wrap_styled_text` drops a reset that
- // ends a line, so without a trailing character the last name's color
- // would bleed onto the "Run …" sentence below.
let _ = write!(
out,
- " {list} \n\nRun `wt config alias show` for the full definitions."
+ " {list}\n\nRun `wt config alias show` for the full definitions."
);
out
}
@@ -1525,9 +1522,7 @@ cmd = [
// The `--help` block is just a comma-separated name list: user/project
// duplicates collapse to one entry, a name colliding with a built-in
// is flagged inline (which built-ins shadow depends on the help
- // context), and a pointer to the full listing follows. There is a
- // trailing space after the list (load-bearing — keeps the last name's
- // color from bleeding onto the "Run …" line; see the function).
+ // context), and a pointer to the full listing follows.
let entries = vec![
(
"commit".to_string(),
@@ -1564,7 +1559,7 @@ cmd = [
render_aliases_help_section(&sorted, HelpContext::TopLevel).ansi_strip(),
@"
Aliases:
- commit, deploy, list (shadowed by built-in), shared
+ commit, deploy, list (shadowed by built-in), shared
Run `wt config alias show` for the full definitions.
"
@@ -1575,7 +1570,7 @@ cmd = [
render_aliases_help_section(&sorted, HelpContext::Step).ansi_strip(),
@"
Aliases:
- commit (shadowed by built-in), deploy, list, shared
+ commit (shadowed by built-in), deploy, list, shared
Run `wt config alias show` for the full definitions.
"
diff --git a/src/styling/format.rs b/src/styling/format.rs
index 4128a6d6a..09ee1b41b 100644
--- a/src/styling/format.rs
+++ b/src/styling/format.rs
@@ -143,7 +143,8 @@ pub fn format_with_gutter(content: &str, max_width: Option<usize>) -> String {
/// 2. These injected codes create visual discontinuity when styled text wraps
///
/// Additionally, wrap_ansi may split between styled content and its reset code,
-/// leaving [0m at the start of continuation lines. We move these to line ends.
+/// leaving [0m at the start of continuation lines. We strip those leading resets.
+/// (A [0m that ends a line is left in place — wrap_ansi keeps line-final resets.)
///
/// IMPORTANT: wrap_ansi only restores foreground colors on continuation lines,
/// not text attributes like dim. We detect this and prepend dim (\x1b[2m) to
diff --git a/tests/snapshots/integration__integration_tests__step_alias__step_help_includes_aliases.snap b/tests/snapshots/integration__integration_tests__step_alias__step_help_includes_aliases.snap
index d1c713cb8..f3bdb0f00 100644
--- a/tests/snapshots/integration__integration_tests__step_alias__step_help_includes_aliases.snap
+++ b/tests/snapshots/integration__integration_tests__step_alias__step_help_includes_aliases.snap
@@ -69,7 +69,7 @@ Usage: wt step [OPTIONS] <COMMAND>
relocate [experimental] Move worktrees to expected paths
Aliases:
- deploy
+ deploy
Run wt config alias show for the full definitions.
diff --git a/tests/snapshots/integration__integration_tests__step_alias__step_list_with_aliases.snap b/tests/snapshots/integration__integration_tests__step_alias__step_list_with_aliases.snap
index 8ab287625..aed41c869 100644
--- a/tests/snapshots/integration__integration_tests__step_alias__step_list_with_aliases.snap
+++ b/tests/snapshots/integration__integration_tests__step_alias__step_list_with_aliases.snap
@@ -68,7 +68,7 @@ Usage: wt step [OPTIONS] <COMMAND>
relocate [experimental] Move worktrees to expected paths
Aliases:
- deploy, port, squash (shadowed by built-in)
+ deploy, port, squash (shadowed by built-in)
Run wt config alias show for the full definitions.