Skip to content

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

style(output): Bold command names in hook messages

Maximilian Roos1dac5470d2b0
diff --git a/src/commands/merge.rs b/src/commands/merge.rs
index 9099ef0bf..99bdb9536 100644
--- a/src/commands/merge.rs
+++ b/src/commands/merge.rs
@@ -616,12 +616,8 @@ pub fn run_pre_commit_commands(
// Execute each command sequentially
for prepared in commands {
- let header = if let Some(name) = &prepared.name {
- format!("πŸ”„ {CYAN}Running pre-commit command {CYAN_BOLD}{name}{CYAN_BOLD:#}:{CYAN:#}")
- } else {
- format!("πŸ”„ {CYAN}Running pre-commit command:{CYAN:#}")
- };
- crate::output::progress(header)?;
+ let label = crate::commands::format_command_label("pre-commit", prepared.name.as_deref());
+ crate::output::progress(format!("πŸ”„ {CYAN}{label}{CYAN:#}"))?;
crate::output::progress(format_bash_with_gutter(&prepared.expanded, ""))?;
if let Err(e) = execute_command_in_worktree(worktree_path, &prepared.expanded) {
@@ -678,12 +674,8 @@ pub fn run_pre_squash_commands(
// Execute each command sequentially
for prepared in commands {
- let header = if let Some(name) = &prepared.name {
- format!("πŸ”„ {CYAN}Running pre-squash command {CYAN_BOLD}{name}{CYAN_BOLD:#}:{CYAN:#}")
- } else {
- format!("πŸ”„ {CYAN}Running pre-squash command:{CYAN:#}")
- };
- crate::output::progress(header)?;
+ let label = crate::commands::format_command_label("pre-squash", prepared.name.as_deref());
+ crate::output::progress(format!("πŸ”„ {CYAN}{label}{CYAN:#}"))?;
crate::output::progress(format_bash_with_gutter(&prepared.expanded, ""))?;
if let Err(e) = execute_command_in_worktree(worktree_path, &prepared.expanded) {
diff --git a/src/commands/mod.rs b/src/commands/mod.rs
index 1b40d9132..3835701ca 100644
--- a/src/commands/mod.rs
+++ b/src/commands/mod.rs
@@ -27,11 +27,16 @@ pub use worktrunk::shell::Shell;
/// Format command execution label with optional command name.
///
/// Examples:
-/// - `format_command_label("post-create", Some("install"))` β†’ `"Running post-create: install"`
+/// - `format_command_label("post-create", Some("install"))` β†’ `"Running post-create: install"` (with bold)
/// - `format_command_label("post-create", None)` β†’ `"Running post-create:"`
pub fn format_command_label(command_type: &str, name: Option<&str>) -> String {
+ use worktrunk::styling::AnstyleStyle;
+
match name {
- Some(name) => format!("Running {command_type}: {name}"),
+ Some(name) => {
+ let bold = AnstyleStyle::new().bold();
+ format!("Running {command_type}: {bold}{name}{bold:#}")
+ }
None => format!("Running {command_type}:"),
}
}
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_bash.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_bash.snap
index 4ece4dbc7..103acde8f 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_bash.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_bash.snap
@@ -3,12 +3,12 @@ source: tests/integration_tests/shell_wrapper.rs
expression: output.normalized().as_ref()
---
πŸ”„ Rebasing onto main...
-πŸ”„ Running pre-merge: format
+πŸ”„ Running pre-merge: format
  echo 'βœ“ Code formatting check passed'
βœ“ Code formatting check passed
-πŸ”„ Running pre-merge: test
+πŸ”„ Running pre-merge: test
  echo 'βœ— Test suite failed: 3 tests failing' && exit 1
βœ— Test suite failed: 3 tests failing
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_bash.snap.new b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_bash.snap.new
new file mode 100644
index 000000000..da9ffbd5a
--- /dev/null
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_bash.snap.new
@@ -0,0 +1,20 @@
+---
+source: tests/integration_tests/shell_wrapper.rs
+assertion_line: 717
+expression: output.normalized().as_ref()
+---
+πŸ”„ Rebasing onto main...
+πŸ”„ Running pre-merge: format
+  echo 'βœ“ Code formatting check passed'
+
+βœ“ Code formatting check passed
+
+πŸ”„ Running pre-merge: test
+  echo 'βœ— Test suite failed: 3 tests failing' && exit 1
+
+βœ— Test suite failed: 3 tests failing
+❌ Pre-merge command failed: test
+
+Command failed with exit code: exit status: 1
+
+πŸ’‘ Use --no-hooks to skip pre-merge commands
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_fish.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_fish.snap
index 3c881fa1f..bc3440deb 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_fish.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_fish.snap
@@ -3,11 +3,11 @@ source: tests/integration_tests/shell_wrapper.rs
expression: output.normalized().as_ref()
---
πŸ”„ Rebasing onto main...
-πŸ”„ Running pre-merge: format
+πŸ”„ Running pre-merge: format
  echo 'βœ“ Code formatting check passed'
βœ“ Code formatting check passed
-πŸ”„ Running pre-merge: test
+πŸ”„ Running pre-merge: test
  echo 'βœ— Test suite failed: 3 tests failing' && exit 1
βœ— Test suite failed: 3 tests failing
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_fish.snap.new b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_fish.snap.new
new file mode 100644
index 000000000..9673315c0
--- /dev/null
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_fish.snap.new
@@ -0,0 +1,19 @@
+---
+source: tests/integration_tests/shell_wrapper.rs
+assertion_line: 717
+expression: output.normalized().as_ref()
+---
+πŸ”„ Rebasing onto main...
+πŸ”„ Running pre-merge: format
+  echo 'βœ“ Code formatting check passed'
+
+βœ“ Code formatting check passed
+πŸ”„ Running pre-merge: test
+  echo 'βœ— Test suite failed: 3 tests failing' && exit 1
+
+βœ— Test suite failed: 3 tests failing
+❌ Pre-merge command failed: test
+
+Command failed with exit code: exit status: 1
+
+πŸ’‘ Use --no-hooks to skip pre-merge commands
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_zsh.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_zsh.snap
index b120b47be..07373c5c9 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_zsh.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_zsh.snap
@@ -10,9 +10,9 @@ Command failed with exit code: exit status: 1
πŸ’‘ Use --no-hooks to skip pre-merge commands
πŸ”„ Rebasing onto main...
-πŸ”„ Running pre-merge: format
+πŸ”„ Running pre-merge: format
  echo 'βœ“ Code formatting check passed'
-πŸ”„ Running pre-merge: test
+πŸ”„ Running pre-merge: test
  echo 'βœ— Test suite failed: 3 tests failing' && exit 1
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_zsh.snap.new b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_zsh.snap.new
new file mode 100644
index 000000000..ebd4c339f
--- /dev/null
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_failure_zsh.snap.new
@@ -0,0 +1,19 @@
+---
+source: tests/integration_tests/shell_wrapper.rs
+assertion_line: 717
+expression: output.normalized().as_ref()
+---
+βœ“ Code formatting check passed
+βœ— Test suite failed: 3 tests failing
+❌ Pre-merge command failed: test
+
+Command failed with exit code: exit status: 1
+
+πŸ’‘ Use --no-hooks to skip pre-merge commands
+πŸ”„ Rebasing onto main...
+πŸ”„ Running pre-merge: format
+  echo 'βœ“ Code formatting check passed'
+
+
+πŸ”„ Running pre-merge: test
+  echo 'βœ— Test suite failed: 3 tests failing' && exit 1
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_bash.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_bash.snap
index 04cd1cfea..a4b7cf9ee 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_bash.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_bash.snap
@@ -3,17 +3,17 @@ source: tests/integration_tests/shell_wrapper.rs
expression: output.normalized().as_ref()
---
πŸ”„ Rebasing onto main...
-πŸ”„ Running pre-merge: format
+πŸ”„ Running pre-merge: format
  echo 'βœ“ Code formatting check passed'
βœ“ Code formatting check passed
-πŸ”„ Running pre-merge: lint
+πŸ”„ Running pre-merge: lint
  echo 'βœ“ Linting passed - no warnings'
βœ“ Linting passed - no warnings
-πŸ”„ Running pre-merge: test
+πŸ”„ Running pre-merge: test
  echo 'βœ“ All 47 tests passed in 2.3s'
βœ“ All 47 tests passed in 2.3s
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_bash.snap.new b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_bash.snap.new
new file mode 100644
index 000000000..bee47d583
--- /dev/null
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_bash.snap.new
@@ -0,0 +1,32 @@
+---
+source: tests/integration_tests/shell_wrapper.rs
+assertion_line: 637
+expression: output.normalized().as_ref()
+---
+πŸ”„ Rebasing onto main...
+πŸ”„ Running pre-merge: format
+  echo 'βœ“ Code formatting check passed'
+
+βœ“ Code formatting check passed
+
+πŸ”„ Running pre-merge: lint
+  echo 'βœ“ Linting passed - no warnings'
+
+βœ“ Linting passed - no warnings
+
+πŸ”„ Running pre-merge: test
+  echo 'βœ“ All 47 tests passed in 2.3s'
+
+βœ“ All 47 tests passed in 2.3s
+
+πŸ”„ Merging 1 commit to main @ d067f01
+
+* d067f01 (HEAD -> feature) Add feature
+
+ feature.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+βœ… Merged to main (1 commit, 1 file, +1) 
+πŸ”„ Cleaning up worktree...
+
+βœ… Returned to primary at [TMPDIR]/test-repo
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_fish.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_fish.snap
index dc2d49504..df5dbd171 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_fish.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_fish.snap
@@ -3,15 +3,15 @@ source: tests/integration_tests/shell_wrapper.rs
expression: output.normalized().as_ref()
---
πŸ”„ Rebasing onto main...
-πŸ”„ Running pre-merge: format
+πŸ”„ Running pre-merge: format
  echo 'βœ“ Code formatting check passed'
βœ“ Code formatting check passed
-πŸ”„ Running pre-merge: lint
+πŸ”„ Running pre-merge: lint
  echo 'βœ“ Linting passed - no warnings'
βœ“ Linting passed - no warnings
-πŸ”„ Running pre-merge: test
+πŸ”„ Running pre-merge: test
  echo 'βœ“ All 47 tests passed in 2.3s'
βœ“ All 47 tests passed in 2.3s
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_fish.snap.new b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_fish.snap.new
new file mode 100644
index 000000000..e9aab353e
--- /dev/null
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_fish.snap.new
@@ -0,0 +1,28 @@
+---
+source: tests/integration_tests/shell_wrapper.rs
+assertion_line: 637
+expression: output.normalized().as_ref()
+---
+πŸ”„ Rebasing onto main...
+πŸ”„ Running pre-merge: format
+  echo 'βœ“ Code formatting check passed'
+
+βœ“ Code formatting check passed
+πŸ”„ Running pre-merge: lint
+  echo 'βœ“ Linting passed - no warnings'
+
+βœ“ Linting passed - no warnings
+πŸ”„ Running pre-merge: test
+  echo 'βœ“ All 47 tests passed in 2.3s'
+
+βœ“ All 47 tests passed in 2.3s
+πŸ”„ Merging 1 commit to main @ d067f01
+
+* d067f01 (HEAD -> feature) Add feature
+
+ feature.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+βœ… Merged to main (1 commit, 1 file, +1) 
+πŸ”„ Cleaning up worktree...
+βœ… Returned to primary at [TMPDIR]/test-repo
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_zsh.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_zsh.snap
index 4c8177274..c1c60b7bc 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_zsh.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_zsh.snap
@@ -6,15 +6,15 @@ expression: output.normalized().as_ref()
βœ“ Linting passed - no warnings
βœ“ All 47 tests passed in 2.3s
πŸ”„ Rebasing onto main...
-πŸ”„ Running pre-merge: format
+πŸ”„ Running pre-merge: format
  echo 'βœ“ Code formatting check passed'
-πŸ”„ Running pre-merge: lint
+πŸ”„ Running pre-merge: lint
  echo 'βœ“ Linting passed - no warnings'
-πŸ”„ Running pre-merge: test
+πŸ”„ Running pre-merge: test
  echo 'βœ“ All 47 tests passed in 2.3s'
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_zsh.snap.new b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_zsh.snap.new
new file mode 100644
index 000000000..c9aaaa649
--- /dev/null
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_pre_merge_success_zsh.snap.new
@@ -0,0 +1,32 @@
+---
+source: tests/integration_tests/shell_wrapper.rs
+assertion_line: 637
+expression: output.normalized().as_ref()
+---
+βœ“ Code formatting check passed
+βœ“ Linting passed - no warnings
+βœ“ All 47 tests passed in 2.3s
+πŸ”„ Rebasing onto main...
+πŸ”„ Running pre-merge: format
+  echo 'βœ“ Code formatting check passed'
+
+
+πŸ”„ Running pre-merge: lint
+  echo 'βœ“ Linting passed - no warnings'
+
+
+πŸ”„ Running pre-merge: test
+  echo 'βœ“ All 47 tests passed in 2.3s'
+
+
+πŸ”„ Merging 1 commit to main @ d067f01
+
+* d067f01 (HEAD -> feature) Add feature
+
+ feature.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+βœ… Merged to main (1 commit, 1 file, +1) 
+πŸ”„ Cleaning up worktree...
+
+βœ… Returned to primary at [TMPDIR]/test-repo
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_bash.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_bash.snap
index d7d7f533b..ecc91e3a9 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_bash.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_bash.snap
@@ -2,20 +2,20 @@
source: tests/integration_tests/shell_wrapper.rs
expression: output.normalized().as_ref()
---
-πŸ”„ Running post-create: 1
+πŸ”„ Running post-create: 1
  echo 'Installing dependencies...'
Installing dependencies...
-πŸ”„ Running post-create: 2
+πŸ”„ Running post-create: 2
  echo 'Building project...'
Building project...
-πŸ”„ Running post-start: server
+πŸ”„ Running post-start: server
  echo 'Starting dev server on port 3000'
-πŸ”„ Running post-start: watch
+πŸ”„ Running post-start: watch
  echo 'Watching for file changes'
βœ… Created new worktree for feature-hooks, changed directory to [TMPDIR]/test-repo.feature-hooks
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_bash.snap.new b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_bash.snap.new
new file mode 100644
index 000000000..67045b929
--- /dev/null
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_bash.snap.new
@@ -0,0 +1,22 @@
+---
+source: tests/integration_tests/shell_wrapper.rs
+assertion_line: 551
+expression: output.normalized().as_ref()
+---
+πŸ”„ Running post-create: 1
+  echo 'Installing dependencies...'
+
+Installing dependencies...
+
+πŸ”„ Running post-create: 2
+  echo 'Building project...'
+
+Building project...
+
+πŸ”„ Running post-start: server
+  echo 'Starting dev server on port 3000'
+
+πŸ”„ Running post-start: watch
+  echo 'Watching for file changes'
+
+βœ… Created new worktree for feature-hooks, changed directory to [TMPDIR]/test-repo.feature-hooks
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_zsh.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_zsh.snap
index 3670f0786..10e75f563 100644
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_zsh.snap
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_zsh.snap
@@ -4,18 +4,18 @@ expression: output.normalized().as_ref()
---
Installing dependencies...
Building project...
-πŸ”„ Running post-create: 1
+πŸ”„ Running post-create: 1
  echo 'Installing dependencies...'
-πŸ”„ Running post-create: 2
+πŸ”„ Running post-create: 2
  echo 'Building project...'
-πŸ”„ Running post-start: server
+πŸ”„ Running post-start: server
  echo 'Starting dev server on port 3000'
-πŸ”„ Running post-start: watch
+πŸ”„ Running post-start: watch
  echo 'Watching for file changes'
βœ… Created new worktree for feature-hooks, changed directory to [TMPDIR]/test-repo.feature-hooks
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_zsh.snap.new b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_zsh.snap.new
new file mode 100644
index 000000000..a384736c9
--- /dev/null
+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_zsh.snap.new
@@ -0,0 +1,22 @@
+---
+source: tests/integration_tests/shell_wrapper.rs
+assertion_line: 551
+expression: output.normalized().as_ref()
+---
+Installing dependencies...
+Building project...
+πŸ”„ Running post-create: 1
+  echo 'Installing dependencies...'
+
+
+πŸ”„ Running post-create: 2
+  echo 'Building project...'
+
+
+πŸ”„ Running post-start: server
+  echo 'Starting dev server on port 3000'
+
+πŸ”„ Running post-start: watch
+  echo 'Watching for file changes'
+
+βœ… Created new worktree for feature-hooks, changed directory to [TMPDIR]/test-repo.feature-hooks
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_named.snap b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_named.snap
index 3dac13d4a..fe198c04a 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_named.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_named.snap
@@ -13,10 +13,11 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpgfHFF8/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpc1lOt8/test-config.toml
---
success: true
exit_code: 0
@@ -33,10 +34,10 @@ exit_code: 0
πŸ”„ Cleaning up worktree...
βœ… Returned to primary at [REPO]
-πŸ”„ Running post-merge: deploy
+πŸ”„ Running post-merge: deploy
  echo 'Deploying branch feature' > deploy.txt
-πŸ”„ Running post-merge: notify
+πŸ”„ Running post-merge: notify
  echo 'Merge to main complete' > notify.txt
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_named.snap.new b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_named.snap.new
new file mode 100644
index 000000000..01ea7d111
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_named.snap.new
@@ -0,0 +1,45 @@
+---
+source: tests/integration_tests/merge.rs
+assertion_line: 12
+info:
+ program: wt
+ args:
+ - merge
+ - main
+ - "--force"
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1761609600"
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpZuDvi6/test-config.toml
+---
+success: true
+exit_code: 0
+----- stdout -----
+πŸ”„ Rebasing onto main...
+πŸ”„ Merging 1 commit to main @ [SHA]
+
+* [SHA] (HEAD -> feature) Add feature file
+
+ feature.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+βœ… Merged to main (1 commit, 1 file, +1) 
+πŸ”„ Cleaning up worktree...
+
+βœ… Returned to primary at [REPO]
+πŸ”„ Running post-merge: deploy
+  echo 'Deploying branch feature' > deploy.txt
+
+πŸ”„ Running post-merge: notify
+  echo 'Merge to main complete' > notify.txt
+
+
+----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_failure.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_failure.snap
index ef633c0f3..daacce5d4 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_failure.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_failure.snap
@@ -17,12 +17,12 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpyVyDrw/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpKlfwQ3/test-config.toml
---
success: false
exit_code: 1
----- stdout -----
-πŸ”„ Running pre-commit command:
+πŸ”„ Running pre-commit:
  exit 1
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_failure.snap.new b/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_failure.snap.new
new file mode 100644
index 000000000..3a6eb9e32
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_failure.snap.new
@@ -0,0 +1,35 @@
+---
+source: tests/integration_tests/merge.rs
+assertion_line: 12
+info:
+ program: wt
+ args:
+ - merge
+ - main
+ - "--force"
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1761609600"
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpUsIoJF/test-config.toml
+---
+success: false
+exit_code: 1
+----- stdout -----
+πŸ”„ Running pre-commit:
+  exit 1
+
+
+----- stderr -----
+❌ Pre-commit command failed
+
+Command failed with exit code: exit status: 1
+
+πŸ’‘ Use --no-hooks to skip pre-commit commands
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snap
index 412c1b99b..2c73d8de2 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snap
@@ -17,12 +17,12 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpIalCkw/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpK99WuG/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-πŸ”„ Running pre-commit command:
+πŸ”„ Running pre-commit:
  echo 'Pre-commit check passed'
πŸ”„ Committing changes... (1 file, +1)
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snap.new b/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snap.new
new file mode 100644
index 000000000..e358c9286
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snap.new
@@ -0,0 +1,49 @@
+---
+source: tests/integration_tests/merge.rs
+assertion_line: 12
+info:
+ program: wt
+ args:
+ - merge
+ - main
+ - "--force"
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1761609600"
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpUEoQg8/test-config.toml
+---
+success: true
+exit_code: 0
+----- stdout -----
+πŸ”„ Running pre-commit:
+  echo 'Pre-commit check passed'
+
+πŸ”„ Committing changes... (1 file, +1)
+πŸ”„ Generating commit message...
+πŸ’‘ Using fallback commit message. Run 'wt config help' to configure LLM-generated messages
+  WIP: Auto-commit before merge
+
+βœ… Committed changes @ [SHA]
+πŸ”„ Rebasing onto main...
+πŸ”„ Merging 1 commit to main @ [SHA]
+
+* [SHA] (HEAD -> feature) WIP: Auto-commit before merge
+
+ feature.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+βœ… Merged to main (1 commit, 1 file, +1) 
+πŸ”„ Cleaning up worktree...
+
+βœ… Returned to primary at [REPO]
+
+----- stderr -----
+Pre-commit check passed
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_combined_output.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_combined_output.snap
index 5192a81ff..df8a78524 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_combined_output.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_combined_output.snap
@@ -4,12 +4,12 @@ expression: output
---
Exit code: 0
πŸ”„ Rebasing onto main...
-πŸ”„ Running pre-merge: first
+πŸ”„ Running pre-merge: first
  echo 'STDOUT-FROM-FIRST' && echo 'STDERR-FROM-FIRST' >&2
STDOUT-FROM-FIRST
STDERR-FROM-FIRST
-πŸ”„ Running pre-merge: second
+πŸ”„ Running pre-merge: second
  echo 'STDOUT-FROM-SECOND' && echo 'STDERR-FROM-SECOND' >&2
STDOUT-FROM-SECOND
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_combined_output.snap.new b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_combined_output.snap.new
new file mode 100644
index 000000000..442e4991d
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_combined_output.snap.new
@@ -0,0 +1,28 @@
+---
+source: tests/integration_tests/merge.rs
+assertion_line: 1170
+expression: output
+---
+Exit code: 0
+πŸ”„ Rebasing onto main...
+πŸ”„ Running pre-merge: first
+  echo 'STDOUT-FROM-FIRST' && echo 'STDERR-FROM-FIRST' >&2
+
+STDOUT-FROM-FIRST
+STDERR-FROM-FIRST
+πŸ”„ Running pre-merge: second
+  echo 'STDOUT-FROM-SECOND' && echo 'STDERR-FROM-SECOND' >&2
+
+STDOUT-FROM-SECOND
+STDERR-FROM-SECOND
+πŸ”„ Merging 1 commit to main @ [SHA]
+
+* [SHA] (HEAD -> feature) Add feature file
+
+ feature.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+βœ… Merged to main (1 commit, 1 file, +1) 
+πŸ”„ Cleaning up worktree...
+
+βœ… Returned to primary at [REPO]
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_named.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_named.snap
index 12d51b130..be9083c4e 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_named.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_named.snap
@@ -17,19 +17,19 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp9gK2VY/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpM0B2Vk/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
πŸ”„ Rebasing onto main...
-πŸ”„ Running pre-merge: format
+πŸ”„ Running pre-merge: format
  exit 0
-πŸ”„ Running pre-merge: lint
+πŸ”„ Running pre-merge: lint
  exit 0
-πŸ”„ Running pre-merge: test
+πŸ”„ Running pre-merge: test
  exit 0
πŸ”„ Merging 1 commit to main @ [SHA]
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_named.snap.new b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_named.snap.new
new file mode 100644
index 000000000..d8254ad0f
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_named.snap.new
@@ -0,0 +1,48 @@
+---
+source: tests/integration_tests/merge.rs
+assertion_line: 12
+info:
+ program: wt
+ args:
+ - merge
+ - main
+ - "--force"
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1761609600"
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpcFiU4y/test-config.toml
+---
+success: true
+exit_code: 0
+----- stdout -----
+πŸ”„ Rebasing onto main...
+πŸ”„ Running pre-merge: format
+  exit 0
+
+πŸ”„ Running pre-merge: lint
+  exit 0
+
+πŸ”„ Running pre-merge: test
+  exit 0
+
+πŸ”„ Merging 1 commit to main @ [SHA]
+
+* [SHA] (HEAD -> feature) Add feature file
+
+ feature.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+βœ… Merged to main (1 commit, 1 file, +1) 
+πŸ”„ Cleaning up worktree...
+
+βœ… Returned to primary at [REPO]
+
+----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_stdout_stderr_ordering.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_stdout_stderr_ordering.snap
index 33645a6c4..f15779039 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_stdout_stderr_ordering.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_stdout_stderr_ordering.snap
@@ -17,16 +17,16 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp3GcE8o/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpeOO9yg/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
πŸ”„ Rebasing onto main...
-πŸ”„ Running pre-merge: check1
+πŸ”„ Running pre-merge: check1
  [PROJECT_ROOT]/tests/fixtures/mixed-output.sh check1 3
-πŸ”„ Running pre-merge: check2
+πŸ”„ Running pre-merge: check2
  [PROJECT_ROOT]/tests/fixtures/mixed-output.sh check2 3
πŸ”„ Merging 1 commit to main @ [SHA]
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_stdout_stderr_ordering.snap.new b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_stdout_stderr_ordering.snap.new
new file mode 100644
index 000000000..ad98787fe
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_stdout_stderr_ordering.snap.new
@@ -0,0 +1,61 @@
+---
+source: tests/integration_tests/merge.rs
+assertion_line: 12
+info:
+ program: wt
+ args:
+ - merge
+ - main
+ - "--force"
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1761609600"
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmprPYyIK/test-config.toml
+---
+success: true
+exit_code: 0
+----- stdout -----
+πŸ”„ Rebasing onto main...
+πŸ”„ Running pre-merge: check1
+  [PROJECT_ROOT]/tests/fixtures/mixed-output.sh check1 3
+
+πŸ”„ Running pre-merge: check2
+  [PROJECT_ROOT]/tests/fixtures/mixed-output.sh check2 3
+
+πŸ”„ Merging 1 commit to main @ [SHA]
+
+* [SHA] (HEAD -> feature) Add feature file
+
+ feature.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+βœ… Merged to main (1 commit, 1 file, +1) 
+πŸ”„ Cleaning up worktree...
+
+βœ… Returned to primary at [REPO]
+
+----- stderr -----
+[check1] stdout line 1
+[check1] stderr line 1
+[check1] stdout line 2
+[check1] stderr line 2
+[check1] stdout line 3
+[check1] stderr line 3
+[check1] stdout complete
+[check1] stderr complete
+[check2] stdout line 1
+[check2] stderr line 1
+[check2] stdout line 2
+[check2] stderr line 2
+[check2] stdout line 3
+[check2] stderr line 3
+[check2] stdout complete
+[check2] stderr complete
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_failure.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_failure.snap
index 988084293..a2ddf0730 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_failure.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_failure.snap
@@ -18,12 +18,12 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpVn5J0G/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp2L2QHX/test-config.toml
---
success: false
exit_code: 1
----- stdout -----
-πŸ”„ Running pre-squash command:
+πŸ”„ Running pre-squash:
  exit 1
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_failure.snap.new b/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_failure.snap.new
new file mode 100644
index 000000000..d3222cfb9
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_failure.snap.new
@@ -0,0 +1,36 @@
+---
+source: tests/integration_tests/merge.rs
+assertion_line: 12
+info:
+ program: wt
+ args:
+ - merge
+ - main
+ - "--squash"
+ - "--force"
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1761609600"
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpRQAFh9/test-config.toml
+---
+success: false
+exit_code: 1
+----- stdout -----
+πŸ”„ Running pre-squash:
+  exit 1
+
+
+----- stderr -----
+❌ Pre-squash command failed
+
+Command failed with exit code: exit status: 1
+
+πŸ’‘ Use --no-hooks to skip pre-squash commands
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_success.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_success.snap
index 0801bbffb..17239afb6 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_success.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_success.snap
@@ -14,15 +14,16 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp5vSpTy/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmptB95SO/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-πŸ”„ Running pre-squash command:
+πŸ”„ Running pre-squash:
  echo 'Pre-squash check passed'
πŸ’‘ Only 1 commit since main - no squashing needed
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_success.snap.new b/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_success.snap.new
new file mode 100644
index 000000000..810018b30
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_squash_command_success.snap.new
@@ -0,0 +1,45 @@
+---
+source: tests/integration_tests/merge.rs
+assertion_line: 12
+info:
+ program: wt
+ args:
+ - merge
+ - main
+ - "--squash"
+ - "--force"
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1761609600"
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpIFsLTm/test-config.toml
+---
+success: true
+exit_code: 0
+----- stdout -----
+πŸ”„ Running pre-squash:
+  echo 'Pre-squash check passed'
+
+πŸ’‘ Only 1 commit since main - no squashing needed
+πŸ”„ Rebasing onto main...
+πŸ”„ Merging 1 commit to main @ [SHA]
+
+* [SHA] (HEAD -> feature) Add feature file
+
+ feature.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+βœ… Merged to main (1 commit, 1 file, +1) 
+πŸ”„ Cleaning up worktree...
+
+βœ… Returned to primary at [REPO]
+
+----- stderr -----
+Pre-squash check passed
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__both_create_and_start.snap b/tests/snapshots/integration__integration_tests__post_start_commands__both_create_and_start.snap
index 979ce1e0a..501b7dbbf 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__both_create_and_start.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__both_create_and_start.snap
@@ -13,10 +13,11 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpLkYtsf/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp1gm53W/test-config.toml
---
success: true
exit_code: 0
@@ -24,7 +25,7 @@ exit_code: 0
πŸ”„ Running post-create:
  echo 'Setup done' > setup.txt
-πŸ”„ Running post-start: server
+πŸ”„ Running post-start: server
  sleep 0.5 && echo 'Server running' > server.txt
βœ… Created new worktree for feature at [REPO].feature
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__both_create_and_start.snap.new b/tests/snapshots/integration__integration_tests__post_start_commands__both_create_and_start.snap.new
new file mode 100644
index 000000000..0829721b8
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__both_create_and_start.snap.new
@@ -0,0 +1,36 @@
+---
+source: tests/integration_tests/post_start_commands.rs
+assertion_line: 27
+info:
+ program: wt
+ args:
+ - switch
+ - "--create"
+ - feature
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1761609600"
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpWmBtPo/test-config.toml
+---
+success: true
+exit_code: 0
+----- stdout -----
+πŸ”„ Running post-create:
+  echo 'Setup done' > setup.txt
+
+πŸ”„ Running post-start: server
+  sleep 0.5 && echo 'Server running' > server.txt
+
+βœ… Created new worktree for feature at [REPO].feature
+
+To enable automatic cd, run: wt config shell
+
+----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiple_commands_array.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiple_commands_array.snap
index 369a67bfe..64fa9006c 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiple_commands_array.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiple_commands_array.snap
@@ -13,18 +13,19 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpXP3KUE/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpMyvnDw/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-πŸ”„ Running post-create: 1
+πŸ”„ Running post-create: 1
  echo 'First'
-πŸ”„ Running post-create: 2
+πŸ”„ Running post-create: 2
  echo 'Second'
βœ… Created new worktree for feature at [REPO].feature
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiple_commands_array.snap.new b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiple_commands_array.snap.new
new file mode 100644
index 000000000..047a11a9a
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiple_commands_array.snap.new
@@ -0,0 +1,38 @@
+---
+source: tests/integration_tests/post_start_commands.rs
+assertion_line: 27
+info:
+ program: wt
+ args:
+ - switch
+ - "--create"
+ - feature
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1761609600"
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpYONNMI/test-config.toml
+---
+success: true
+exit_code: 0
+----- stdout -----
+πŸ”„ Running post-create: 1
+  echo 'First'
+
+πŸ”„ Running post-create: 2
+  echo 'Second'
+
+βœ… Created new worktree for feature at [REPO].feature
+
+To enable automatic cd, run: wt config shell
+
+----- stderr -----
+First
+Second
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_named_commands.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_named_commands.snap
index 1ae1f0e93..572caa99a 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_named_commands.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_named_commands.snap
@@ -13,18 +13,19 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpFeEv7z/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp0mBOY1/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-πŸ”„ Running post-create: install
+πŸ”„ Running post-create: install
  echo 'Installing deps'
-πŸ”„ Running post-create: setup
+πŸ”„ Running post-create: setup
  echo 'Running setup'
βœ… Created new worktree for feature at [REPO].feature
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_named_commands.snap.new b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_named_commands.snap.new
new file mode 100644
index 000000000..74b05eb9a
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_named_commands.snap.new
@@ -0,0 +1,38 @@
+---
+source: tests/integration_tests/post_start_commands.rs
+assertion_line: 27
+info:
+ program: wt
+ args:
+ - switch
+ - "--create"
+ - feature
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1761609600"
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp05xeYK/test-config.toml
+---
+success: true
+exit_code: 0
+----- stdout -----
+πŸ”„ Running post-create: install
+  echo 'Installing deps'
+
+πŸ”„ Running post-create: setup
+  echo 'Running setup'
+
+βœ… Created new worktree for feature at [REPO].feature
+
+To enable automatic cd, run: wt config shell
+
+----- stderr -----
+Installing deps
+Running setup
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_template_expansion.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_template_expansion.snap
index 3d3a81e47..696c197c0 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_template_expansion.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_template_expansion.snap
@@ -13,24 +13,25 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp8UllPf/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpNSkMrr/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-πŸ”„ Running post-create: 1
+πŸ”„ Running post-create: 1
  echo 'Repo: test-repo' > info.txt
-πŸ”„ Running post-create: 2
+πŸ”„ Running post-create: 2
  echo 'Branch: feature-test' >> info.txt
-πŸ”„ Running post-create: 3
+πŸ”„ Running post-create: 3
  echo 'Worktree: [REPO].feature-test' >> info.txt
-πŸ”„ Running post-create: 4
+πŸ”„ Running post-create: 4
  echo 'Root: [REPO]' >> info.txt
βœ… Created new worktree for feature/test at [REPO].feature-test
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_template_expansion.snap.new b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_template_expansion.snap.new
new file mode 100644
index 000000000..1181d9392
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_template_expansion.snap.new
@@ -0,0 +1,42 @@
+---
+source: tests/integration_tests/post_start_commands.rs
+assertion_line: 27
+info:
+ program: wt
+ args:
+ - switch
+ - "--create"
+ - feature/test
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1761609600"
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp3Blgxf/test-config.toml
+---
+success: true
+exit_code: 0
+----- stdout -----
+πŸ”„ Running post-create: 1
+  echo 'Repo: test-repo' > info.txt
+
+πŸ”„ Running post-create: 2
+  echo 'Branch: feature-test' >> info.txt
+
+πŸ”„ Running post-create: 3
+  echo 'Worktree: [REPO].feature-test' >> info.txt
+
+πŸ”„ Running post-create: 4
+  echo 'Root: [REPO]' >> info.txt
+
+βœ… Created new worktree for feature/test at [REPO].feature-test
+
+To enable automatic cd, run: wt config shell
+
+----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiple_background.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiple_background.snap
index fd4f94fc8..13068b018 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiple_background.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiple_background.snap
@@ -13,18 +13,19 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpGKkTa1/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpoL8MgV/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-πŸ”„ Running post-start: task1
+πŸ”„ Running post-start: task1
  echo 'Task 1 running' > task1.txt
-πŸ”„ Running post-start: task2
+πŸ”„ Running post-start: task2
  echo 'Task 2 running' > task2.txt
βœ… Created new worktree for feature at [REPO].feature
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiple_background.snap.new b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiple_background.snap.new
new file mode 100644
index 000000000..703ac33d6
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiple_background.snap.new
@@ -0,0 +1,36 @@
+---
+source: tests/integration_tests/post_start_commands.rs
+assertion_line: 27
+info:
+ program: wt
+ args:
+ - switch
+ - "--create"
+ - feature
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1761609600"
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpGxLWwc/test-config.toml
+---
+success: true
+exit_code: 0
+----- stdout -----
+πŸ”„ Running post-start: task1
+  echo 'Task 1 running' > task1.txt
+
+πŸ”„ Running post-start: task2
+  echo 'Task 2 running' > task2.txt
+
+βœ… Created new worktree for feature at [REPO].feature
+
+To enable automatic cd, run: wt config shell
+
+----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_separate_logs.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_separate_logs.snap
index 44d506f9b..16b382f44 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_separate_logs.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_separate_logs.snap
@@ -13,21 +13,22 @@ info:
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpuLxpWM/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpA5nf1x/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-πŸ”„ Running post-start: task1
+πŸ”„ Running post-start: task1
  echo 'TASK1_OUTPUT'
-πŸ”„ Running post-start: task2
+πŸ”„ Running post-start: task2
  echo 'TASK2_OUTPUT'
-πŸ”„ Running post-start: task3
+πŸ”„ Running post-start: task3
  echo 'TASK3_OUTPUT'
βœ… Created new worktree for feature at [REPO].feature
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_separate_logs.snap.new b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_separate_logs.snap.new
new file mode 100644
index 000000000..c09d21fee
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_separate_logs.snap.new
@@ -0,0 +1,39 @@
+---
+source: tests/integration_tests/post_start_commands.rs
+assertion_line: 27
+info:
+ program: wt
+ args:
+ - switch
+ - "--create"
+ - feature
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "150"
+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
+ GIT_CONFIG_GLOBAL: /dev/null
+ GIT_CONFIG_SYSTEM: /dev/null
+ GIT_EDITOR: ""
+ LANG: C
+ LC_ALL: C
+ SOURCE_DATE_EPOCH: "1761609600"
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpZkaPxN/test-config.toml
+---
+success: true
+exit_code: 0
+----- stdout -----
+πŸ”„ Running post-start: task1
+  echo 'TASK1_OUTPUT'
+
+πŸ”„ Running post-start: task2
+  echo 'TASK2_OUTPUT'
+
+πŸ”„ Running post-start: task3
+  echo 'TASK3_OUTPUT'
+
+βœ… Created new worktree for feature at [REPO].feature
+
+To enable automatic cd, run: wt config shell
+
+----- stderr -----