Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
feat: Add pre-commit hook to enforce output system usage
Maximilian Roos5523e3201807
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yamlindex 385c6353d..6b3d09a15 100644--- a/.pre-commit-config.yaml+++ b/.pre-commit-config.yaml@@ -38,6 +38,13 @@ repos:language: pygreptypes: ["rust"]entry: "dbg!"+ - id: check-output-system+ name: check-output-system+ description: Commands using --internal must use crate::output::* functions+ language: script+ entry: scripts/check-output-system.sh+ pass_filenames: false+ files: "^src/commands/(worktree|merge)\\.rs$"ci:# Currently network access isn't supported in the CI product.diff --git a/CLAUDE.md b/CLAUDE.mdindex 65253eea8..6259c8a01 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -615,6 +615,78 @@ output::progress("π‘ Use 'wt list' to see all worktrees")?;If the output function you need doesn't exist yet, follow the pattern in "Adding New Output Functions" above.+### Architectural Constraint: --internal Commands Must Use Output System++**CRITICAL: Commands that support `--internal` mode must NEVER use direct print macros (`print!()`, `println!()`, `eprint!()`, or `eprintln!()`).**++Commands that support the `--internal` flag (switch, remove, merge) emit directives for shell wrapper integration. Using direct print statements bypasses the output system and causes directive leaks - directives become visible to users in interactive mode.++#### The Problem++When a command uses `println!()` directly:++1. **Interactive mode**: Output appears correctly (luck, not design)+2. **Directive mode**: Direct prints get concatenated with NUL-terminated directives, causing directives to leak into user-visible output++**Example of the bug:**+```+π Starting (background):+__WORKTRUNK_CD__/Users/name/workspace/repo.branch+Created new worktree...+```++The `__WORKTRUNK_CD__` directive should be invisible, parsed only by the shell wrapper.++#### The Solution++**Commands supporting `--internal` must use `crate::output::*` functions exclusively:**++```rust+// β NEVER DO THIS in commands that support --internal+println!("π Starting operation...");+print!("{}", formatted_output);+eprintln!("Some progress message");+eprint!("{}", error_message);++// β ALWAYS DO THIS+crate::output::progress("π Starting operation...")?;+crate::output::progress(formatted_output)?;+crate::output::progress("Some progress message")?;+crate::output::progress(error_message)?;+```++#### Which Commands Are Restricted++Files that support `--internal` mode (see `scripts/check-output-system.sh`):++- `src/commands/worktree.rs` (switch, remove commands)+- `src/commands/merge.rs` (merge command)++Other command files can use direct `println!()` if they never emit directives.++#### Enforcement++The restriction is enforced by:++1. **Lint script**: `scripts/check-output-system.sh` checks restricted files for direct print usage+2. **Integration tests**: `tests/integration_tests/shell_wrapper.rs` executes commands through the actual bash wrapper to catch directive leaks++Run the lint script to verify compliance:+```bash+./scripts/check-output-system.sh+```++#### Why This Matters++This constraint maintains architectural integrity:++- **Separation of concerns**: Output formatting is centralized in the output system+- **Mode transparency**: Commands don't need to know which mode they're running in+- **Protocol correctness**: Directives are properly NUL-terminated and never leak+- **Testability**: Shell integration can be tested end-to-end++When adding new functionality to restricted commands, always ask: "Does this need output?" If yes, use `crate::output::progress()` or `crate::output::success()`, never direct prints.+## Testing Guidelines### Testing with --execute Commandsdiff --git a/scripts/check-output-system.sh b/scripts/check-output-system.shnew file mode 100755index 000000000..a3a900425--- /dev/null+++ b/scripts/check-output-system.sh@@ -0,0 +1,55 @@+#!/usr/bin/env bash+# Check that commands using --internal mode don't bypass the output system+#+# Commands that support --internal (switch, remove, merge) must use the output+# system (crate::output::*) rather than direct println!/eprintln! calls.+# This prevents directive leaks in shell wrapper integration.++set -euo pipefail++# Files that must use output system (support --internal mode)+RESTRICTED_FILES=(+ "src/commands/worktree.rs"+ "src/commands/merge.rs"+)++# Allowed exceptions (test code, etc.)+ALLOWED_PATTERNS=(+ "spacing_test\.rs"+ "command_approval\.rs"+)++exit_code=0++for file in "${RESTRICTED_FILES[@]}"; do+ if [[ ! -f "$file" ]]; then+ continue+ fi++ # Check for direct print!/println!/eprint!/eprintln! usage+ while IFS= read -r line; do+ # Skip if it matches any allowed pattern+ skip=false+ for pattern in "${ALLOWED_PATTERNS[@]}"; do+ if echo "$line" | grep -q "$pattern"; then+ skip=true+ break+ fi+ done++ if [[ "$skip" == "true" ]]; then+ continue+ fi++ echo "β Direct output in $line"+ echo " Commands using --internal must use crate::output::* functions"+ echo " Replace print!/println! with output::progress() or output::success()"+ exit_code=1+ done < <(grep -n "print!\|println!\|eprint!\|eprintln!" "$file" | grep -v "//.*print" || true)+done++if [[ $exit_code -eq 0 ]]; then+ echo "β Output system check passed"+fi++exit $exit_codediff --git a/src/commands/merge.rs b/src/commands/merge.rsindex b33c9288b..8a72096e6 100644--- a/src/commands/merge.rs+++ b/src/commands/merge.rs@@ -1,6 +1,6 @@use worktrunk::config::{ProjectConfig, WorktrunkConfig};use worktrunk::git::{GitError, Repository};-use worktrunk::styling::{AnstyleStyle, CYAN, CYAN_BOLD, eprint, format_with_gutter, println};+use worktrunk::styling::{AnstyleStyle, CYAN, CYAN_BOLD, format_with_gutter};use super::command_executor::{CommandContext, prepare_project_commands};use super::worktree::handle_push;@@ -151,11 +151,13 @@ pub fn handle_merge(}// Print comprehensive summary- println!();+ crate::output::progress("")+ .map_err(|e| GitError::CommandFailed(format!("Output error: {}", e)))?;handle_merge_summary_output(Some(&primary_worktree_dir))?;} else {// Print comprehensive summary (worktree preserved)- println!();+ crate::output::progress("")+ .map_err(|e| GitError::CommandFailed(format!("Output error: {}", e)))?;handle_merge_summary_output(None)?;}@@ -233,11 +235,8 @@ fn handle_commit_changes(// Display the generated commit messagelet formatted_message = format_commit_message_for_display(&commit_message);- print!("{}", format_with_gutter(&formatted_message, "", None));-- // Flush stdout to ensure message appears immediately (before any subsequent stderr output)- use std::io::Write;- let _ = std::io::stdout().flush();+ crate::output::progress(format_with_gutter(&formatted_message, "", None))+ .map_err(|e| GitError::CommandFailed(e.to_string()))?;// Commitrepo.run_command(&["commit", "-m", &commit_message])@@ -313,11 +312,8 @@ fn handle_squash(target_branch: &str) -> Result<Option<usize>, GitError> {// Display the generated commit messagelet formatted_message = format_commit_message_for_display(&commit_message);- print!("{}", format_with_gutter(&formatted_message, "", None));-- // Flush stdout to ensure message appears immediately (before any subsequent stderr output)- use std::io::Write;- let _ = std::io::stdout().flush();+ crate::output::progress(format_with_gutter(&formatted_message, "", None))+ .map_err(|e| GitError::CommandFailed(e.to_string()))?;// Reset to merge base (soft reset stages all changes)repo.run_command(&["reset", "--soft", &merge_base])@@ -358,19 +354,18 @@ fn run_pre_merge_commands("Pre-merge commands",|_, command| {let dim = AnstyleStyle::new().dimmed();- println!("{dim}Skipping pre-merge command: {command}{dim:#}");+ crate::output::progress(format!("{dim}Skipping pre-merge command: {command}{dim:#}"))+ .ok();},)?;for prepared in commands {- use std::io::Write;- use worktrunk::styling;-- println!(+ crate::output::progress(format!("π {CYAN}Running pre-merge command {CYAN_BOLD}{name}{CYAN_BOLD:#}:{CYAN:#}",name = prepared.name- );- eprint!("{}", format_with_gutter(&prepared.expanded, "", None)); // Gutter at column 0- let _ = styling::stderr().flush();+ ))+ .map_err(|e| GitError::CommandFailed(format!("Output error: {}", e)))?;+ crate::output::progress(format_with_gutter(&prepared.expanded, "", None))+ .map_err(|e| GitError::CommandFailed(format!("Output error: {}", e)))?;if let Err(e) = execute_command_in_worktree(worktree_path, &prepared.expanded) {return Err(GitError::PreMergeCommandFailed {@@ -422,7 +417,7 @@ fn execute_post_merge_commands("Post-merge commands",|_, command| {let dim = AnstyleStyle::new().dimmed();- println!("{dim}Skipping command: {command}{dim:#}");+ crate::output::progress(format!("{dim}Skipping command: {command}{dim:#}")).ok();},)?;@@ -432,28 +427,27 @@ fn execute_post_merge_commands(// Execute each command sequentially in the main worktreefor prepared in commands {- use std::io::Write;- println!(+ crate::output::progress(format!("π {CYAN}Running post-merge command {CYAN_BOLD}{name}{CYAN_BOLD:#}:{CYAN:#}",name = prepared.name- );- eprint!("{}", format_with_gutter(&prepared.expanded, "", None));- let _ = std::io::stderr().flush();+ ))+ .map_err(|e| GitError::CommandFailed(format!("Output error: {}", e)))?;+ crate::output::progress(format_with_gutter(&prepared.expanded, "", None))+ .map_err(|e| GitError::CommandFailed(format!("Output error: {}", e)))?;if let Err(e) = execute_command_in_worktree(main_worktree_path, &prepared.expanded) {use worktrunk::styling::WARNING_EMOJI;let warning_bold = WARNING.bold();- println!(+ crate::output::progress(format!("{WARNING_EMOJI} {WARNING}Command {warning_bold}{name}{warning_bold:#} failed: {e}{WARNING:#}",name = prepared.name,- );+ ))+ .map_err(|e| GitError::CommandFailed(format!("Output error: {}", e)))?;// Continue with other commands even if one fails}}- use std::io::Write;- let _ = std::io::stdout().flush();- let _ = std::io::stderr().flush();+ crate::output::flush().map_err(|e| GitError::CommandFailed(format!("Output error: {}", e)))?;Ok(())}diff --git a/src/commands/worktree.rs b/src/commands/worktree.rsindex 051478998..c3122b33f 100644--- a/src/commands/worktree.rs+++ b/src/commands/worktree.rs@@ -105,7 +105,7 @@ use worktrunk::config::{ProjectConfig, WorktrunkConfig};use worktrunk::git::{GitError, Repository};use worktrunk::styling::{ADDITION, AnstyleStyle, CYAN, CYAN_BOLD, DELETION, GREEN, GREEN_BOLD, SUCCESS_EMOJI, WARNING,- WARNING_EMOJI, eprint, format_with_gutter, println,+ WARNING_EMOJI, format_with_gutter,};use super::command_executor::{CommandContext, prepare_project_commands};@@ -161,9 +161,10 @@ pub fn handle_switch(// Check if base flag was provided without create flagif base.is_some() && !create {- println!(+ crate::output::progress(format!("{WARNING_EMOJI} {WARNING}--base flag is only used with --create, ignoring{WARNING:#}"- );+ ))+ .map_err(|e| GitError::CommandFailed(format!("Output error: {}", e)))?;}// Check if worktree already exists for this branch@@ -261,11 +262,15 @@ fn remove_current_worktree(repo: &Repository) -> Result<RemoveResult, GitError>// Remove the worktreeif let Err(e) = repo.remove_worktree(&worktree_root) {- println!("{WARNING_EMOJI} {WARNING}Failed to remove worktree: {e}{WARNING:#}");- println!(+ crate::output::progress(format!(+ "{WARNING_EMOJI} {WARNING}Failed to remove worktree: {e}{WARNING:#}"+ ))+ .map_err(|e| GitError::CommandFailed(format!("Output error: {}", e)))?;+ crate::output::progress(format!("You may need to run 'git worktree remove {}' manually",worktree_root.display()- );+ ))+ .map_err(|e| GitError::CommandFailed(format!("Output error: {}", e)))?;}Ok(RemoveResult::RemovedWorktree {@@ -320,11 +325,15 @@ fn remove_worktree_by_name(repo: &Repository, branch_name: &str) -> Result<Remov// Remove the worktreeif let Err(e) = repo.remove_worktree(&worktree_path) {- println!("{WARNING_EMOJI} {WARNING}Failed to remove worktree: {e}{WARNING:#}");- println!(+ crate::output::progress(format!(+ "{WARNING_EMOJI} {WARNING}Failed to remove worktree: {e}{WARNING:#}"+ ))+ .map_err(|e| GitError::CommandFailed(format!("Output error: {}", e)))?;+ crate::output::progress(format!("You may need to run 'git worktree remove {}' manually",worktree_path.display()- );+ ))+ .map_err(|e| GitError::CommandFailed(format!("Output error: {}", e)))?;}// If we removed the current worktree, return to primary@@ -419,7 +428,7 @@ fn execute_post_create_commands("Post-create commands",|_, command| {let dim = AnstyleStyle::new().dimmed();- println!("{dim}Skipping command: {command}{dim:#}");+ crate::output::progress(format!("{dim}Skipping command: {command}{dim:#}")).ok();},)?;@@ -429,24 +438,23 @@ fn execute_post_create_commands(// Execute each command sequentiallyfor prepared in commands {- use std::io::Write;- println!("π {CYAN}Executing (post-create):{CYAN:#}");- eprint!("{}", format_with_gutter(&prepared.expanded, "", None)); // Gutter at column 0- let _ = std::io::stderr().flush();+ crate::output::progress(format!("π {CYAN}Executing (post-create):{CYAN:#}"))+ .map_err(|e| GitError::CommandFailed(format!("Output error: {}", e)))?;+ crate::output::progress(format_with_gutter(&prepared.expanded, "", None))+ .map_err(|e| GitError::CommandFailed(format!("Output error: {}", e)))?;if let Err(e) = execute_command_in_worktree(worktree_path, &prepared.expanded) {let warning_bold = WARNING.bold();- println!(+ crate::output::progress(format!("{WARNING_EMOJI} {WARNING}Command {warning_bold}{name}{warning_bold:#} failed: {e}{WARNING:#}",name = prepared.name,- );+ ))+ .map_err(|e| GitError::CommandFailed(format!("Output error: {}", e)))?;// Continue with other commands even if one fails}}- use std::io::Write;- let _ = std::io::stdout().flush();- let _ = std::io::stderr().flush();+ crate::output::flush().map_err(|e| GitError::CommandFailed(format!("Output error: {}", e)))?;Ok(())}@@ -478,7 +486,7 @@ fn spawn_post_start_commands("Post-start commands",|_, command| {let dim = AnstyleStyle::new().dimmed();- println!("{dim}Skipping command: {command}{dim:#}");+ crate::output::progress(format!("{dim}Skipping command: {command}{dim:#}")).ok();},)?;@@ -488,10 +496,10 @@ fn spawn_post_start_commands(// Spawn each command as a detached background processfor prepared in commands {- use std::io::Write;- println!("π {CYAN}Starting (background):{CYAN:#}");- eprint!("{}", format_with_gutter(&prepared.expanded, "", None));- let _ = std::io::stderr().flush();+ crate::output::progress(format!("π {CYAN}Starting (background):{CYAN:#}"))+ .map_err(|e| GitError::CommandFailed(format!("Output error: {}", e)))?;+ crate::output::progress(format_with_gutter(&prepared.expanded, "", None))+ .map_err(|e| GitError::CommandFailed(format!("Output error: {}", e)))?;match spawn_detached(worktree_path, &prepared.expanded, &prepared.name) {Ok(_log_path) => {@@ -499,17 +507,16 @@ fn spawn_post_start_commands(// Log file path not shown - only needed for debugging failures}Err(e) => {- println!(+ crate::output::progress(format!("{WARNING_EMOJI} {WARNING}Failed to spawn '{name}': {e}{WARNING:#}",name = prepared.name,- );+ ))+ .map_err(|e| GitError::CommandFailed(format!("Output error: {}", e)))?;}}}- use std::io::Write;- let _ = std::io::stdout().flush();- let _ = std::io::stderr().flush();+ crate::output::flush().map_err(|e| GitError::CommandFailed(format!("Output error: {}", e)))?;Ok(())}diff --git a/tests/integration_tests/directives.rs b/tests/integration_tests/directives.rsindex 6b003ead8..ef0c796de 100644--- a/tests/integration_tests/directives.rs+++ b/tests/integration_tests/directives.rs@@ -173,7 +173,7 @@ fn test_merge_internal_keep() {.arg("--keep").current_dir(&feature_wt);- assert_cmd_snapshot!(cmd, @"success: true\nexit_code: 0\n----- stdout -----\n\nKept worktree (use 'wt remove' to clean up)\0\n----- stderr -----");+ assert_cmd_snapshot!(cmd, @"success: true\nexit_code: 0\n----- stdout -----\nKept worktree (use 'wt remove' to clean up)\0\n----- stderr -----");});}@@ -229,6 +229,6 @@ fn test_merge_internal_remove() {.arg("main").current_dir(&feature_wt);- assert_cmd_snapshot!(cmd, @"success: true\nexit_code: 0\n----- stdout -----\n__WORKTRUNK_CD__[PATH]\0\nReturned to primary at [REPO]\0\n----- stderr -----");+ assert_cmd_snapshot!(cmd, @"success: true\nexit_code: 0\n----- stdout -----\n__WORKTRUNK_CD__[PATH]\0Returned to primary at [REPO]\0\n----- stderr -----");});}diff --git a/tests/integration_tests/mod.rs b/tests/integration_tests/mod.rsindex e8dc293e2..986281320 100644--- a/tests/integration_tests/mod.rs+++ b/tests/integration_tests/mod.rs@@ -15,5 +15,6 @@ pub mod merge;pub mod post_start_commands;pub mod push;pub mod remove;+pub mod shell_wrapper;pub mod spacing_edge_cases;pub mod switch;diff --git a/tests/integration_tests/shell_wrapper.rs b/tests/integration_tests/shell_wrapper.rsnew file mode 100644index 000000000..478982465--- /dev/null+++ b/tests/integration_tests/shell_wrapper.rs@@ -0,0 +1,259 @@+//! Shell wrapper integration tests+//!+//! Tests that verify the complete shell integration path - commands executed through+//! the actual shell wrapper (_wt_exec in bash/zsh/fish).+//!+//! These tests ensure that:+//! - Directives are never leaked to users+//! - Output is properly formatted for humans+//! - Shell integration works end-to-end as users experience it++use crate::common::TestRepo;+use insta::assert_snapshot;+use insta_cmd::get_cargo_bin;+use std::fs;+use std::path::Path;+use std::process::Command;++/// Generate the bash wrapper script from template+fn generate_bash_wrapper(_repo: &TestRepo) -> String {+ let template_path = Path::new(env!("CARGO_MANIFEST_DIR"))+ .join("templates")+ .join("bash.sh");+ let template = fs::read_to_string(&template_path).expect("Failed to read bash template");++ // Simple template substitution (matches what `wt init` does)+ template+ .replace("{{ shell_name }}", "bash")+ .replace("{{ cmd_prefix }}", "wt")+}++/// Execute a command through the bash shell wrapper+///+/// This simulates what actually happens when users run `wt switch`, etc. in their shell:+/// 1. The `wt` function is defined (from shell integration)+/// 2. It calls `_wt_exec --internal switch ...`+/// 3. The wrapper parses NUL-delimited output and handles directives+/// 4. Users see only the final human-friendly output+///+/// Returns the combined stdout+stderr output as users would see it+fn exec_through_bash_wrapper(repo: &TestRepo, subcommand: &str, args: &[&str]) -> String {+ let wrapper_script = generate_bash_wrapper(repo);++ // Get the path to wt binary+ let wt_bin = get_cargo_bin("wt");++ // Build the full script that sources the wrapper and runs the command+ let mut script = String::new();+ script.push_str("set -e\n"); // Exit on error+ script.push_str(&format!("export WORKTRUNK_BIN='{}'\n", wt_bin.display()));+ script.push_str(&format!(+ "export WORKTRUNK_CONFIG_PATH='{}'\n",+ repo.test_config_path().display()+ ));+ script.push_str("export CLICOLOR_FORCE=1\n"); // Force colors for snapshot testing++ // Source the wrapper+ script.push_str(&wrapper_script);+ script.push_str("\n");++ // Run the command+ script.push_str("wt ");+ script.push_str(subcommand);+ for arg in args {+ script.push_str(" ");+ // Quote arguments with spaces+ if arg.contains(' ') {+ script.push_str("'");+ script.push_str(arg);+ script.push_str("'");+ } else {+ script.push_str(arg);+ }+ }+ script.push_str("\n");++ // Execute through bash+ let mut cmd = Command::new("bash");+ cmd.arg("-c").arg(&script).current_dir(repo.root_path());++ // Configure git environment+ repo.clean_cli_env(&mut cmd);++ let output = cmd.output().expect("Failed to execute bash wrapper");++ // Combine stdout and stderr as users would see in a terminal+ let mut combined = String::from_utf8_lossy(&output.stdout).to_string();+ if !output.stderr.is_empty() {+ combined.push_str(&String::from_utf8_lossy(&output.stderr));+ }++ // Check that command succeeded+ if !output.status.success() {+ panic!(+ "Command failed with exit code: {:?}\nOutput:\n{}",+ output.status.code(),+ combined+ );+ }++ combined+}++/// Assert that output contains no directive leaks+fn assert_no_directive_leaks(output: &str) {+ assert!(+ !output.contains("__WORKTRUNK_CD__"),+ "Output contains leaked __WORKTRUNK_CD__ directive:\n{}",+ output+ );+ assert!(+ !output.contains("__WORKTRUNK_EXEC__"),+ "Output contains leaked __WORKTRUNK_EXEC__ directive:\n{}",+ output+ );+}++#[test]+fn test_switch_create_through_wrapper_no_directive_leak() {+ let repo = TestRepo::new();+ repo.commit("Initial commit");++ let output = exec_through_bash_wrapper(&repo, "switch", &["--create", "feature"]);++ // The critical assertion: directives must never appear in user-facing output+ assert_no_directive_leaks(&output);++ // Normalize paths in output for snapshot testing+ let normalized = regex::Regex::new(r"/private/var/folders/[^/]+/[^/]+/T/\.tmp[^/]+")+ .unwrap()+ .replace_all(&output, "[TMPDIR]");++ // Snapshot the output for regression testing+ assert_snapshot!(normalized.as_ref());+}++#[test]+fn test_switch_with_post_start_command_no_directive_leak() {+ let repo = TestRepo::new();+ repo.commit("Initial commit");++ // Configure a post-start command in the project config (this is where the bug manifests)+ // The println! in handle_post_start_commands causes directive leaks+ let config_dir = repo.root_path().join(".config");+ fs::create_dir_all(&config_dir).expect("Failed to create .config dir");+ fs::write(+ config_dir.join("wt.toml"),+ r#"post-start-command = "echo 'test command executed'""#,+ )+ .expect("Failed to write project config");++ repo.commit("Add post-start command");++ // Pre-approve the command in user config+ fs::write(+ repo.test_config_path(),+ r#"worktree-path = "../{main-worktree}.{branch}"++[[approved-commands]]+project = "test-repo"+command = "echo 'test command executed'"+"#,+ )+ .expect("Failed to write user config");++ let output = exec_through_bash_wrapper(&repo, "switch", &["--create", "feature-with-hooks"]);++ // The critical assertion: directives must never appear in user-facing output+ // This is where the bug occurs - "π Starting (background):" is printed with println!+ // which causes it to concatenate with the directive+ assert_no_directive_leaks(&output);++ // Normalize paths in output for snapshot testing+ let normalized = regex::Regex::new(r"/private/var/folders/[^/]+/[^/]+/T/\.tmp[^/]+")+ .unwrap()+ .replace_all(&output, "[TMPDIR]");++ // Snapshot the output+ assert_snapshot!(normalized.as_ref());+}++#[test]+fn test_switch_with_execute_through_wrapper() {+ let repo = TestRepo::new();+ repo.commit("Initial commit");++ // Use --force to skip approval prompt in tests+ let output = exec_through_bash_wrapper(+ &repo,+ "switch",+ &[+ "--create",+ "test-exec",+ "--execute",+ "echo executed",+ "--force",+ ],+ );++ // No directives should leak+ assert_no_directive_leaks(&output);++ // The executed command output should appear+ assert!(+ output.contains("executed"),+ "Execute command output missing"+ );++ // Normalize paths in output for snapshot testing+ let normalized = regex::Regex::new(r"/private/var/folders/[^/]+/[^/]+/T/\.tmp[^/]+")+ .unwrap()+ .replace_all(&output, "[TMPDIR]");++ // Snapshot the output+ assert_snapshot!(normalized.as_ref());+}++#[test]+fn test_remove_through_wrapper_no_directive_leak() {+ let mut repo = TestRepo::new();+ repo.commit("Initial commit");++ // Create a worktree to remove+ repo.add_worktree("to-remove", "to-remove");++ let output = exec_through_bash_wrapper(&repo, "remove", &["to-remove"]);++ // No directives should leak+ assert_no_directive_leaks(&output);++ // Normalize paths in output for snapshot testing+ let normalized = regex::Regex::new(r"/private/var/folders/[^/]+/[^/]+/T/\.tmp[^/]+")+ .unwrap()+ .replace_all(&output, "[TMPDIR]");++ // Snapshot the output+ assert_snapshot!(normalized.as_ref());+}++#[test]+fn test_merge_through_wrapper_no_directive_leak() {+ let mut repo = TestRepo::new();+ repo.commit("Initial commit");++ // Create a feature branch+ repo.add_worktree("feature", "feature");++ let output = exec_through_bash_wrapper(&repo, "merge", &["main"]);++ // No directives should leak+ assert_no_directive_leaks(&output);++ // Normalize paths in output for snapshot testing+ let normalized = regex::Regex::new(r"/private/var/folders/[^/]+/[^/]+/T/\.tmp[^/]+")+ .unwrap()+ .replace_all(&output, "[TMPDIR]");++ // Snapshot the output+ assert_snapshot!(normalized.as_ref());+}diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__merge_through_wrapper_no_directive_leak.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__merge_through_wrapper_no_directive_leak.snapnew file mode 100644index 000000000..257f059b0--- /dev/null+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__merge_through_wrapper_no_directive_leak.snap@@ -0,0 +1,5 @@+---+source: tests/integration_tests/shell_wrapper.rs+expression: output+---+Already on main, nothing to mergediff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__remove_through_wrapper_no_directive_leak.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__remove_through_wrapper_no_directive_leak.snapnew file mode 100644index 000000000..822ddf544--- /dev/null+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__remove_through_wrapper_no_directive_leak.snap@@ -0,0 +1,5 @@+---+source: tests/integration_tests/shell_wrapper.rs+expression: output+---+Removed worktree for to-removediff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__switch_create_through_wrapper_no_directive_leak.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__switch_create_through_wrapper_no_directive_leak.snapnew file mode 100644index 000000000..b66a41aa2--- /dev/null+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__switch_create_through_wrapper_no_directive_leak.snap@@ -0,0 +1,5 @@+---+source: tests/integration_tests/shell_wrapper.rs+expression: normalized.as_ref()+---+Created new worktree for feature at [TMPDIR]/test-repo.featurediff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__switch_with_execute_through_wrapper.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__switch_with_execute_through_wrapper.snapnew file mode 100644index 000000000..884eb3b3b--- /dev/null+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__switch_with_execute_through_wrapper.snap@@ -0,0 +1,6 @@+---+source: tests/integration_tests/shell_wrapper.rs+expression: normalized.as_ref()+---+Created new worktree for test-exec at [TMPDIR]/test-repo.test-exec+executeddiff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__switch_with_post_start_command_no_directive_leak.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__switch_with_post_start_command_no_directive_leak.snapnew file mode 100644index 000000000..97233a8db--- /dev/null+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__switch_with_post_start_command_no_directive_leak.snap@@ -0,0 +1,5 @@+---+source: tests/integration_tests/shell_wrapper.rs+expression: normalized.as_ref()+---+Created new worktree for feature-with-hooks at [TMPDIR]/test-repo.feature-with-hooksdiff --git a/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_and_squash.snap b/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_and_squash.snapindex ba9e41004..29becd2bb 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_and_squash.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_and_squash.snap@@ -12,12 +12,13 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"WORKTRUNK_COMMIT_GENERATION__ARGS: "fix: update file 1 content"WORKTRUNK_COMMIT_GENERATION__COMMAND: echo- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpRCPkNs/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpjf00t9/test-config.toml---success: trueexit_code: 0@@ -26,6 +27,7 @@ exit_code: 0π [36mCommitting uncommitted changes...[0mπ [36mGenerating commit message...[0m[40m [0m [1mWIP: Auto-commit before merge[0m+β [32mCommitted changes[0mπ [36mSquashing 3 commits into one...[0mπ [36mGenerating squash commit message...[0m@@ -35,6 +37,7 @@ exit_code: 0[40m [0m - feat: add file 1[40m [0m - feat: add file 2[40m [0m - WIP: Auto-commit before merge+β [32mSquashed 3 commits into one[0mπ [36mRebasing onto [1m[36mmain[0m...[0mπ [36mPushing 1 commit to [1m[36mmain[0m @ [SHA][0mdiff --git a/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_deterministic.snap b/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_deterministic.snapindex 828ef5ca3..66c40758d 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_deterministic.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_deterministic.snap@@ -11,10 +11,11 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpR2o3kf/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpfVoqsS/test-config.toml---success: trueexit_code: 0@@ -23,6 +24,7 @@ exit_code: 0π [36mCommitting uncommitted changes...[0mπ [36mGenerating commit message...[0m[40m [0m [1mWIP: Auto-commit before merge[0m+β [32mCommitted changes[0mπ [36mRebasing onto [1m[36mmain[0m...[0mπ [36mPushing 2 commits to [1m[36mmain[0m @ [SHA][0mdiff --git a/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_with_llm.snap b/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_with_llm.snapindex 52134e882..1001cdf5a 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_with_llm.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_with_llm.snap@@ -11,12 +11,13 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"WORKTRUNK_COMMIT_GENERATION__ARGS: "fix: improve auth validation logic"WORKTRUNK_COMMIT_GENERATION__COMMAND: echo- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpk7hPdt/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpyISaoT/test-config.toml---success: trueexit_code: 0@@ -25,6 +26,7 @@ exit_code: 0π [36mCommitting uncommitted changes...[0mπ [36mGenerating commit message...[0m[40m [0m [1mWIP: Auto-commit before merge[0m+β [32mCommitted changes[0mπ [36mRebasing onto [1m[36mmain[0m...[0mπ [36mPushing 2 commits to [1m[36mmain[0m @ [SHA][0mdiff --git a/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_with_message.snap b/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_with_message.snapindex f40165d4c..d1618b915 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_with_message.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_with_message.snap@@ -13,12 +13,13 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"WORKTRUNK_COMMIT_GENERATION__ARGS: "feat: complete user dashboard"WORKTRUNK_COMMIT_GENERATION__COMMAND: echo- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpVLVTF2/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpNYiicC/test-config.toml---success: trueexit_code: 0@@ -27,6 +28,7 @@ exit_code: 0π [36mCommitting uncommitted changes...[0mπ [36mGenerating commit message...[0m[40m [0m [1mWIP: Auto-commit before merge[0m+β [32mCommitted changes[0mπ [36mRebasing onto [1m[36mmain[0m...[0mπ [36mPushing 2 commits to [1m[36mmain[0m @ [SHA][0mdiff --git a/tests/snapshots/integration__integration_tests__merge__merge_dirty_working_tree.snap b/tests/snapshots/integration__integration_tests__merge__merge_dirty_working_tree.snapindex 0707b0435..defd2fa11 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_dirty_working_tree.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_dirty_working_tree.snap@@ -11,10 +11,11 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpfoGsi5/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpbdVTnG/test-config.toml---success: trueexit_code: 0@@ -23,6 +24,7 @@ exit_code: 0π [36mCommitting uncommitted changes...[0mπ [36mGenerating commit message...[0m[40m [0m [1mWIP: Auto-commit before merge[0m+β [32mCommitted changes[0mπ [36mRebasing onto [1m[36mmain[0m...[0mπ [36mPushing 1 commit to [1m[36mmain[0m @ [SHA][0mdiff --git a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_failure.snap b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_failure.snapindex b49281eb6..4e1a1781d 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_failure.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_failure.snap@@ -12,10 +12,11 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpEaSRwb/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpUHOAYS/test-config.toml---success: trueexit_code: 0@@ -31,10 +32,11 @@ exit_code: 0β [32mPushed to [1m[32mmain[0m (1 commit, 1 file, [32m+1[0m) [0mπ [36mRunning post-merge command [1m[36mcmd[0m:[0m+[40m [0m exit 1+π‘ [33mCommand [1m[33mcmd[0m failed: Command failed with exit code: exit status: 1[0mπ [36mCleaning up worktree...[0mβ [32mReturned to primary at [REPO][0m----- stderr ------[40m [0m exit 1diff --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.snapindex 4f72306dc..f1ea7e888 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@@ -12,10 +12,11 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp7n7ThK/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpopy8pE/test-config.toml---success: trueexit_code: 0@@ -31,11 +32,13 @@ exit_code: 0β [32mPushed to [1m[32mmain[0m (1 commit, 1 file, [32m+1[0m) [0mπ [36mRunning post-merge command [1m[36mdeploy[0m:[0m+[40m [0m echo 'Deploying branch feature' > deploy.txt+π [36mRunning post-merge command [1m[36mnotify[0m:[0m+[40m [0m echo 'Merge to main complete' > notify.txt+π [36mCleaning up worktree...[0mβ [32mReturned to primary at [REPO][0m----- stderr ------[40m [0m echo 'Deploying branch feature' > deploy.txt-[40m [0m echo 'Merge to main complete' > notify.txtdiff --git a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_success.snap b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_success.snapindex b5276fd9a..4af969ce4 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_success.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_post_merge_command_success.snap@@ -12,10 +12,11 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpf378rG/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpmdFOXu/test-config.toml---success: trueexit_code: 0@@ -31,9 +32,10 @@ exit_code: 0β [32mPushed to [1m[32mmain[0m (1 commit, 1 file, [32m+1[0m) [0mπ [36mRunning post-merge command [1m[36mcmd[0m:[0m+[40m [0m echo 'merged feature to main' > post-merge-ran.txt+π [36mCleaning up worktree...[0mβ [32mReturned to primary at [REPO][0m----- stderr ------[40m [0m echo 'merged feature to main' > post-merge-ran.txtdiff --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.snapindex c224b5d42..0dc798304 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@@ -6,10 +6,12 @@ Exit code: 0π [36mValidating merge...[0mπ [36mRunning pre-merge command [1m[36mfirst[0m:[0m[40m [0m echo 'STDOUT-FROM-FIRST' && echo 'STDERR-FROM-FIRST' >&2+STDOUT-FROM-FIRSTSTDERR-FROM-FIRSTπ [36mRunning pre-merge command [1m[36msecond[0m:[0m[40m [0m echo 'STDOUT-FROM-SECOND' && echo 'STDERR-FROM-SECOND' >&2+STDOUT-FROM-SECONDSTDERR-FROM-SECONDπ [36mRebasing onto [1m[36mmain[0m...[0mdiff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_failure.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_failure.snapindex fe5315245..017a5f023 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_failure.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_failure.snap@@ -12,19 +12,21 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpV2uaP9/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpbUwp56/test-config.toml---success: falseexit_code: 1----- stdout -----π [36mValidating merge...[0mπ [36mRunning pre-merge command [1m[36mcmd[0m:[0m+[40m [0m exit 1+----- stderr ------[40m [0m exit 1β [31mPre-merge command failed: [1m[31mcmd[0m[0mCommand failed with exit code: exit status: 1diff --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.snapindex a1ac8fdb3..e568740a3 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@@ -12,18 +12,25 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpp8Gpxi/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp3zDJ9v/test-config.toml---success: trueexit_code: 0----- stdout -----π [36mValidating merge...[0mπ [36mRunning pre-merge command [1m[36mformat[0m:[0m+[40m [0m exit 0+π [36mRunning pre-merge command [1m[36mlint[0m:[0m+[40m [0m exit 0+π [36mRunning pre-merge command [1m[36mtest[0m:[0m+[40m [0m exit 0+π [36mRebasing onto [1m[36mmain[0m...[0mπ [36mPushing 1 commit to [1m[36mmain[0m @ [SHA][0m@@ -38,6 +45,3 @@ exit_code: 0β [32mReturned to primary at [REPO][0m----- stderr ------[40m [0m exit 0-[40m [0m exit 0-[40m [0m exit 0diff --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.snapindex 9fa914301..0e3c6511b 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@@ -12,17 +12,22 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpYmlz8I/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpSpc2U4/test-config.toml---success: trueexit_code: 0----- stdout -----π [36mValidating merge...[0mπ [36mRunning pre-merge command [1m[36mcheck1[0m:[0m+[40m [0m [PROJECT_ROOT]/tests/fixtures/mixed-output.sh check1 3+π [36mRunning pre-merge command [1m[36mcheck2[0m:[0m+[40m [0m [PROJECT_ROOT]/tests/fixtures/mixed-output.sh check2 3+π [36mRebasing onto [1m[36mmain[0m...[0mπ [36mPushing 1 commit to [1m[36mmain[0m @ [SHA][0m@@ -37,8 +42,6 @@ exit_code: 0β [32mReturned to primary at [REPO][0m----- stderr ------[40m [0m [PROJECT_ROOT]/tests/fixtures/mixed-output.sh-[40m [0m check1 3[check1] stdout line 1[check1] stderr line 1[check1] stdout line 2@@ -47,8 +50,6 @@ exit_code: 0[check1] stderr line 3[check1] stdout complete[check1] stderr complete-[40m [0m [PROJECT_ROOT]/tests/fixtures/mixed-output.sh-[40m [0m check2 3[check2] stdout line 1[check2] stderr line 1[check2] stdout line 2diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_success.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_success.snapindex d4b171047..41717053e 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_success.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_command_success.snap@@ -12,16 +12,19 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpv4BWZG/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpomJvjp/test-config.toml---success: trueexit_code: 0----- stdout -----π [36mValidating merge...[0mπ [36mRunning pre-merge command [1m[36mcmd[0m:[0m+[40m [0m exit 0+π [36mRebasing onto [1m[36mmain[0m...[0mπ [36mPushing 1 commit to [1m[36mmain[0m @ [SHA][0m@@ -36,4 +39,3 @@ exit_code: 0β [32mReturned to primary at [REPO][0m----- stderr ------[40m [0m exit 0diff --git a/tests/snapshots/integration__integration_tests__merge__merge_squash_deterministic.snap b/tests/snapshots/integration__integration_tests__merge__merge_squash_deterministic.snapindex 7e25fe72d..e12f1ad3f 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_squash_deterministic.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_squash_deterministic.snap@@ -12,10 +12,11 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpeMdAoH/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpzHUxKY/test-config.toml---success: trueexit_code: 0@@ -29,6 +30,7 @@ exit_code: 0[40m [0m - feat: add file 1[40m [0m - fix: update logic[40m [0m - docs: update readme+β [32mSquashed 3 commits into one[0mπ [36mRebasing onto [1m[36mmain[0m...[0mπ [36mPushing 1 commit to [1m[36mmain[0m @ [SHA][0mdiff --git a/tests/snapshots/integration__integration_tests__merge__merge_squash_llm_fallback.snap b/tests/snapshots/integration__integration_tests__merge__merge_squash_llm_fallback.snapindex 74077021c..629fff671 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_squash_llm_fallback.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_squash_llm_fallback.snap@@ -12,11 +12,12 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"WORKTRUNK_COMMIT_GENERATION__COMMAND: nonexistent-llm-command- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpB5jNHK/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpsbfQSr/test-config.toml---success: trueexit_code: 0@@ -29,6 +30,7 @@ exit_code: 0[40m [0m Combined commits:[40m [0m - feat: new feature[40m [0m - fix: bug fix+β [32mSquashed 2 commits into one[0mπ [36mRebasing onto [1m[36mmain[0m...[0mπ [36mPushing 1 commit to [1m[36mmain[0m @ [SHA][0mdiff --git a/tests/snapshots/integration__integration_tests__merge__merge_squash_with_llm.snap b/tests/snapshots/integration__integration_tests__merge__merge_squash_with_llm.snapindex 842cb3be4..0c7842942 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_squash_with_llm.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_squash_with_llm.snap@@ -12,13 +12,14 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"WORKTRUNK_COMMIT_GENERATION__ARGS__0: "-c"WORKTRUNK_COMMIT_GENERATION__ARGS__1: "cat >/dev/null && echo 'feat: implement user authentication system'"WORKTRUNK_COMMIT_GENERATION__COMMAND: sh- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpEpPXtB/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpmCA23B/test-config.toml---success: trueexit_code: 0@@ -31,6 +32,7 @@ exit_code: 0[40m [0m Combined commits:[40m [0m - feat: add authentication[40m [0m - fix: handle edge case+β [32mSquashed 2 commits into one[0mπ [36mRebasing onto [1m[36mmain[0m...[0mπ [36mPushing 1 commit to [1m[36mmain[0m @ [SHA][0mdiff --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.snapindex 23d958c7a..5c105d4a5 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@@ -12,20 +12,23 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp8Rk5dB/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp3ewwWu/test-config.toml---success: trueexit_code: 0----- stdout -----π [36mExecuting (post-create):[0m+[40m [0m echo 'Setup done' > setup.txt+π [36mStarting (background):[0m+[40m [0m sleep 0.5 && echo 'Server running' > server.txt+β [32mCreated new worktree for [1mfeature[0m at [REPO].feature[0mTo enable automatic cd, run: wt configure-shell----- stderr ------[40m [0m echo 'Setup done' > setup.txt-[40m [0m sleep 0.5 && echo 'Server running' > server.txtdiff --git a/tests/snapshots/integration__integration_tests__post_start_commands__execute_with_post_start.snap b/tests/snapshots/integration__integration_tests__post_start_commands__execute_with_post_start.snapindex 734b26d5d..9e1a13f66 100644--- a/tests/snapshots/integration__integration_tests__post_start_commands__execute_with_post_start.snap+++ b/tests/snapshots/integration__integration_tests__post_start_commands__execute_with_post_start.snap@@ -14,16 +14,18 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpvNFfsG/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpIjv95o/test-config.toml---success: trueexit_code: 0----- stdout -----π [36mStarting (background):[0m+[40m [0m echo 'Background task' > background.txt+β [32mCreated new worktree for [1mfeature[0m at [REPO].feature[0m----- stderr ------[40m [0m echo 'Background task' > background.txtdiff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_failing_command.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_failing_command.snapindex d93e90739..bd3d0f29b 100644--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_failing_command.snap+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_failing_command.snap@@ -12,19 +12,21 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp4TBmYZ/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpTCxwzC/test-config.toml---success: trueexit_code: 0----- stdout -----π [36mExecuting (post-create):[0m+[40m [0m exit 1+π‘ [33mCommand [1m[33mcmd[0m failed: Command failed with exit code: exit status: 1[0mβ [32mCreated new worktree for [1mfeature[0m at [REPO].feature[0mTo enable automatic cd, run: wt configure-shell----- stderr ------[40m [0m exit 1diff --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.snapindex 5349b1064..b2877cd7d 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@@ -12,22 +12,25 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpBMuWNX/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpsmacvw/test-config.toml---success: trueexit_code: 0----- stdout -----π [36mExecuting (post-create):[0m+[40m [0m echo 'First'+π [36mExecuting (post-create):[0m+[40m [0m echo 'Second'+β [32mCreated new worktree for [1mfeature[0m at [REPO].feature[0mTo enable automatic cd, run: wt configure-shell----- stderr ------[40m [0m echo 'First'First-[40m [0m echo 'Second'Seconddiff --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.snapindex 9480999c2..ce03d0b02 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@@ -12,22 +12,25 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpyGUlO6/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpggIPgR/test-config.toml---success: trueexit_code: 0----- stdout -----π [36mExecuting (post-create):[0m+[40m [0m echo 'Installing deps'+π [36mExecuting (post-create):[0m+[40m [0m echo 'Running setup'+β [32mCreated new worktree for [1mfeature[0m at [REPO].feature[0mTo enable automatic cd, run: wt configure-shell----- stderr ------[40m [0m echo 'Installing deps'Installing deps-[40m [0m echo 'Running setup'Running setupdiff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_single_command.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_single_command.snapindex b05b82735..c412b050f 100644--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_single_command.snap+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_single_command.snap@@ -12,19 +12,21 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpYRpRMc/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpZMSoxL/test-config.toml---success: trueexit_code: 0----- stdout -----π [36mExecuting (post-create):[0m+[40m [0m echo 'Setup complete'+β [32mCreated new worktree for [1mfeature[0m at [REPO].feature[0mTo enable automatic cd, run: wt configure-shell----- stderr ------[40m [0m echo 'Setup complete'Setup completediff --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.snapindex 4df5cc89c..51e771670 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@@ -12,28 +12,33 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpJGXiTv/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpEM2Izh/test-config.toml---success: trueexit_code: 0----- stdout -----π [36mExecuting (post-create):[0m-π [36mExecuting (post-create):[0m-π [36mExecuting (post-create):[0m-π [36mExecuting (post-create):[0m-β [32mCreated new worktree for [1mfeature/test[0m at [REPO].feature-test[0m--To enable automatic cd, run: wt configure-shell------- stderr -----[40m [0m echo 'Repo: test-repo' > info.txt++π [36mExecuting (post-create):[0m[40m [0m echo 'Branch: feature-test' >> info.txt++π [36mExecuting (post-create):[0m[40m [0m echo 'Worktree:[40m [0m [REPO].feature-test'[40m [0m >> info.txt++π [36mExecuting (post-create):[0m[40m [0m echo 'Root:[40m [0m [REPO]'[40m [0m >> info.txt++β [32mCreated new worktree for [1mfeature/test[0m at [REPO].feature-test[0m++To enable automatic cd, run: wt configure-shell++----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_complex_shell.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_complex_shell.snapindex 81cd2ac6c..f2e93bb9a 100644--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_complex_shell.snap+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_complex_shell.snap@@ -12,20 +12,22 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpQ1olMT/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpEEHf2b/test-config.toml---success: trueexit_code: 0----- stdout -----π [36mStarting (background):[0m+[40m [0m echo 'line1+[40m [0m line2+[40m [0m line3' | grep line2 > filtered.txt+β [32mCreated new worktree for [1mfeature[0m at [REPO].feature[0mTo enable automatic cd, run: wt configure-shell----- stderr ------[40m [0m echo 'line1-[40m [0m line2-[40m [0m line3' | grep line2 > filtered.txtdiff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_invalid_command.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_invalid_command.snapindex 68077ec5a..860a5bc14 100644--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_invalid_command.snap+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_invalid_command.snap@@ -12,18 +12,20 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpeVTM7X/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpB7MUEg/test-config.toml---success: trueexit_code: 0----- stdout -----π [36mStarting (background):[0m+[40m [0m echo 'unclosed quote+β [32mCreated new worktree for [1mfeature[0m at [REPO].feature[0mTo enable automatic cd, run: wt configure-shell----- stderr ------[40m [0m echo 'unclosed quotediff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_log_captures_output.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_log_captures_output.snapindex b2ca5b071..fd58f8a99 100644--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_log_captures_output.snap+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_log_captures_output.snap@@ -12,18 +12,20 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpD72dMX/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp49oM06/test-config.toml---success: trueexit_code: 0----- stdout -----π [36mStarting (background):[0m+[40m [0m echo 'stdout output' && echo 'stderr output' >&2+β [32mCreated new worktree for [1mfeature[0m at [REPO].feature[0mTo enable automatic cd, run: wt configure-shell----- stderr ------[40m [0m echo 'stdout output' && echo 'stderr output' >&2diff --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.snapindex a482e13c9..ed4f9a29b 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@@ -12,20 +12,23 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpZRNtMz/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmplFMHEn/test-config.toml---success: trueexit_code: 0----- stdout -----π [36mStarting (background):[0m+[40m [0m echo 'Task 1 running' > task1.txt+π [36mStarting (background):[0m+[40m [0m echo 'Task 2 running' > task2.txt+β [32mCreated new worktree for [1mfeature[0m at [REPO].feature[0mTo enable automatic cd, run: wt configure-shell----- stderr ------[40m [0m echo 'Task 1 running' > task1.txt-[40m [0m echo 'Task 2 running' > task2.txtdiff --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.snapindex 86aa70a15..38694eef1 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@@ -12,22 +12,26 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpUAadHA/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpURXoki/test-config.toml---success: trueexit_code: 0----- stdout -----π [36mStarting (background):[0m+[40m [0m echo 'TASK1_OUTPUT'+π [36mStarting (background):[0m+[40m [0m echo 'TASK2_OUTPUT'+π [36mStarting (background):[0m+[40m [0m echo 'TASK3_OUTPUT'+β [32mCreated new worktree for [1mfeature[0m at [REPO].feature[0mTo enable automatic cd, run: wt configure-shell----- stderr ------[40m [0m echo 'TASK1_OUTPUT'-[40m [0m echo 'TASK2_OUTPUT'-[40m [0m echo 'TASK3_OUTPUT'diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_single_background.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_single_background.snapindex 682840746..9f838301e 100644--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_single_background.snap+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_single_background.snap@@ -12,18 +12,20 @@ info:GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpo7xtAh/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpJzrX60/test-config.toml---success: trueexit_code: 0----- stdout -----π [36mStarting (background):[0m+[40m [0m sleep 1 && echo 'Background task done' > background.txt+β [32mCreated new worktree for [1mfeature[0m at [REPO].feature[0mTo enable automatic cd, run: wt configure-shell----- stderr ------[40m [0m sleep 1 && echo 'Background task done' > background.txt