Skip to content

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

feat: Adjust terminal width calculation

Maximilian Roos2002bcdec109
diff --git a/src/commands/list/layout.rs b/src/commands/list/layout.rs
index 60ababfd5..29808cb70 100644
--- a/src/commands/list/layout.rs
+++ b/src/commands/list/layout.rs
@@ -183,15 +183,9 @@ pub const HEADER_CI: &str = "CI";
pub const HEADER_COMMIT: &str = "Commit";
pub const HEADER_MESSAGE: &str = "Message";
-/// Get safe terminal width for list rendering.
-///
-/// Reserves 2 columns as a safety margin to prevent line wrapping:
-/// - Off-by-one terminal behavior
-/// - Emoji width safety margin
-///
-/// This matches the clamping logic in progressive mode (collect.rs).
+/// Get terminal width for list rendering.
pub fn get_safe_list_width() -> usize {
- get_terminal_width().saturating_sub(2)
+ get_terminal_width()
}
/// Ensures a column width is at least as wide as its header.
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__long_branch_names.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__long_branch_names.snap
index c78b29667..84f3cff18 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__long_branch_names.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__long_branch_names.snap
@@ -22,10 +22,10 @@ exit_code: 0
----- stdout -----
----- stderr -----
- Branch Status HEAD± main↕ Path Remote⇅ Commit Age
-@ main ^ ./test-repo b834638e 10mo
-+ another-extremely-long-name-here ∅ ./another-extremely-long-name-here b834638e 10mo
-+ short ∅ ./short b834638e 10mo
-+ very-long-feature-branch-name ∅ ./very-long-feature-branch-name b834638e 10mo
+ Branch Status HEAD± main↕ Path Remote⇅ Commit Age Message
+@ main ^ ./test-repo b834638e 10mo Initial commit
++ another-extremely-long-name-here ∅ ./another-extremely-long-name-here b834638e 10mo Initial commit
++ short ∅ ./short b834638e 10mo Initial commit
++ very-long-feature-branch-name ∅ ./very-long-feature-branch-name b834638e 10mo Initial commit
-⚪ Showing 4 worktrees, 1 column hidden
+⚪ Showing 4 worktrees
diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__mixed_length_branch_names.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__mixed_length_branch_names.snap
index 0b0e1f199..5599613a4 100644
--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__mixed_length_branch_names.snap
+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__mixed_length_branch_names.snap
@@ -22,10 +22,10 @@ exit_code: 0
----- stdout -----
----- stderr -----
- Branch Status HEAD± main↕ Path Remote⇅ Commit Age
-@ main ^ ./test-repo b834638e 10mo
-+ long ∅ ./extremely-long-branch-name-that-might-cause-layout-issues b834638e 10mo
-+ medium ∅ ./medium-length-name b834638e 10mo
-+ x ∅ ./x b834638e 10mo
+ Branch Status HEAD± main↕ Path Remote⇅ Commit Age Message
+@ main ^ ./test-repo b834638e 10mo Initial commit
++ long ∅ ./extremely-long-branch-name-that-might-cause-layout-issues b834638e 10mo Initial commit
++ medium ∅ ./medium-length-name b834638e 10mo Initial commit
++ x ∅ ./x b834638e 10mo Initial commit
-⚪ Showing 4 worktrees, 1 column hidden
+⚪ Showing 4 worktrees