Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
Refactor: Introduce global output context for consistent messaging
Maximilian Roosa16c6bb6cc09
diff --git a/.gitattributes b/.gitattributesnew file mode 100644index 000000000..9196aff20--- /dev/null+++ b/.gitattributes@@ -0,0 +1,2 @@+# Treat snapshot test files as text for proper diffs+*.snap text diffdiff --git a/src/commands/merge.rs b/src/commands/merge.rsindex bf2ac4e6d..919352543 100644--- a/src/commands/merge.rs+++ b/src/commands/merge.rs@@ -101,7 +101,7 @@ pub fn handle_merge(let result = handle_remove()?;// Display output based on mode- handle_remove_output(&result, internal)?;+ handle_remove_output(&result)?;// Check if we need to switch to target branchlet primary_repo = Repository::at(&primary_worktree_dir);@@ -126,23 +126,11 @@ pub fn handle_merge(// Print comprehensive summaryprintln!();- handle_merge_summary_output(- ¤t_branch,- &target_branch,- squashed_count,- true,- internal,- )?;+ handle_merge_summary_output(¤t_branch, &target_branch, squashed_count, true)?;} else {// Print comprehensive summary (worktree preserved)println!();- handle_merge_summary_output(- ¤t_branch,- &target_branch,- squashed_count,- false,- internal,- )?;+ handle_merge_summary_output(¤t_branch, &target_branch, squashed_count, false)?;}Ok(())@@ -155,15 +143,14 @@ fn format_merge_summary(squashed_count: Option<usize>,cleaned_up: bool,) -> String {- let green = AnstyleStyle::new().fg_color(Some(Color::Ansi(AnsiColor::Green)));- let green_bold = green.bold();+ let bold = AnstyleStyle::new().bold();let dim = AnstyleStyle::new().dimmed();- let mut output = format!("✅ {green}Merge complete{green:#}\n\n");+ let mut output = format!("Merge complete\n\n");// Show what was mergedoutput.push_str(&format!(- " {dim}Merged: {green_bold}{from_branch}{green_bold:#} → {green_bold}{to_branch}{green_bold:#}{dim:#}\n"+ " {dim}Merged: {bold}{from_branch}{bold:#} → {bold}{to_branch}{bold:#}{dim:#}\n"));// Show squash info if applicable@@ -183,33 +170,20 @@ fn format_merge_summary(output}-/// Handle output for merge summary-///-/// In internal mode: outputs directives for shell wrapper-/// In non-internal mode: prints message directly+/// Handle output for merge summary using global output contextfn handle_merge_summary_output(from_branch: &str,to_branch: &str,squashed_count: Option<usize>,cleaned_up: bool,- internal: bool,) -> Result<(), GitError> {- use crate::output::{Directive, DirectiveOutput};-let message = format_merge_summary(from_branch, to_branch, squashed_count, cleaned_up);- if internal {- // Internal mode: output directives for shell wrapper- let mut output = DirectiveOutput::new();- output.add(Directive::Message(message));+ // Show success message (formatting added by OutputContext)+ crate::output::success(message).map_err(|e| GitError::CommandFailed(e.to_string()))?;- output- .write_to_stdout()- .map_err(|e| GitError::CommandFailed(e.to_string()))?;- } else {- // Non-internal mode: print directly- println!("{}", message);- }+ // Flush output+ crate::output::flush().map_err(|e| GitError::CommandFailed(e.to_string()))?;Ok(())}diff --git a/src/main.rs b/src/main.rsindex d2749c0f8..6bb704797 100644--- a/src/main.rs+++ b/src/main.rs@@ -311,23 +311,39 @@ fn main() {force,no_config_commands,internal,- } => WorktrunkConfig::load()- .map_err(|e| GitError::CommandFailed(format!("Failed to load config: {}", e)))- .and_then(|config| {- handle_switch(- &branch,- create,- base.as_deref(),- force,- no_config_commands,- &config,- )- .and_then(|result| {- handle_switch_output(&result, &branch, execute.as_deref(), internal)+ } => {+ // Initialize output context based on mode+ let output_mode = if internal {+ output::OutputMode::Directive+ } else {+ output::OutputMode::Interactive+ };+ output::initialize(output_mode);++ WorktrunkConfig::load()+ .map_err(|e| GitError::CommandFailed(format!("Failed to load config: {}", e)))+ .and_then(|config| {+ handle_switch(+ &branch,+ create,+ base.as_deref(),+ force,+ no_config_commands,+ &config,+ )+ .and_then(|result| handle_switch_output(&result, &branch, execute.as_deref()))})- }),+ }Commands::Remove { internal } => {- handle_remove().and_then(|result| handle_remove_output(&result, internal))+ // Initialize output context based on mode+ let output_mode = if internal {+ output::OutputMode::Directive+ } else {+ output::OutputMode::Interactive+ };+ output::initialize(output_mode);++ handle_remove().and_then(|result| handle_remove_output(&result))}Commands::Push {target,@@ -341,15 +357,25 @@ fn main() {no_verify,force,internal,- } => handle_merge(- target.as_deref(),- squash,- keep,- message.as_deref(),- no_verify,- force,- internal,- ),+ } => {+ // Initialize output context based on mode+ let output_mode = if internal {+ output::OutputMode::Directive+ } else {+ output::OutputMode::Interactive+ };+ output::initialize(output_mode);++ handle_merge(+ target.as_deref(),+ squash,+ keep,+ message.as_deref(),+ no_verify,+ force,+ internal,+ )+ }Commands::Completion { shell } => {let mut cli_cmd = Cli::command();handle_completion(shell, &mut cli_cmd);diff --git a/src/output.rs b/src/output.rsdeleted file mode 100644index b63db5cef..000000000--- a/src/output.rs+++ /dev/null@@ -1,242 +0,0 @@-//! Output and presentation layer for worktree commands.-//!-//! This module handles all presentation logic, keeping it separate from business logic.-//! It provides:-//! - Directive protocol types for shell integration-//! - Message formatting for results-//! - Output rendering for both internal and non-internal modes--use std::io::{self, Write};-use std::path::{Path, PathBuf};-use worktrunk::git::GitError;-use worktrunk::shell::Shell;-use worktrunk::styling::{AnstyleStyle, println};--use crate::commands::worktree::{RemoveResult, SwitchResult};--/// A directive for the shell wrapper to execute-#[derive(Debug, Clone)]-pub enum Directive {- /// Change directory to the given path- ChangeDirectory(PathBuf),- /// Execute a command in the current directory- Execute(String),- /// Print a message to the user- Message(String),-}--/// Output containing multiple directives for shell integration-#[derive(Default)]-pub struct DirectiveOutput {- directives: Vec<Directive>,-}--impl DirectiveOutput {- /// Create a new directive output- pub fn new() -> Self {- Self::default()- }-- /// Add a directive- pub fn add(&mut self, directive: Directive) -> &mut Self {- self.directives.push(directive);- self- }-- /// Write directives to stdout with NUL termination- ///- /// Format: `<directive_content>\0<directive_content>\0...`- /// Each directive is NUL-terminated to support multi-line commands.- pub fn write_to_stdout(&self) -> io::Result<()> {- let mut stdout = io::stdout();-- for directive in &self.directives {- match directive {- Directive::ChangeDirectory(path) => {- write!(stdout, "__WORKTRUNK_CD__{}\0", path.display())?;- }- Directive::Execute(cmd) => {- write!(stdout, "__WORKTRUNK_EXEC__{}\0", cmd)?;- }- Directive::Message(msg) => {- write!(stdout, "{}\0", msg)?;- }- }- }-- // Final newline for readability in logs- stdout.write_all(b"\n")?;- Ok(())- }-}--/// Format a message for a switch operation-pub fn format_switch_message(result: &SwitchResult, branch: &str) -> String {- use anstyle::{AnsiColor, Color};- let green = AnstyleStyle::new().fg_color(Some(Color::Ansi(AnsiColor::Green)));- let green_bold = green.bold();-- match result {- SwitchResult::ExistingWorktree(_) => {- format!(- "✅ {green}Switched to worktree for {green_bold}{branch}{green_bold:#}{green:#}"- )- }- SwitchResult::CreatedWorktree {- path,- created_branch,- } => {- let dim = AnstyleStyle::new().dimmed();- if *created_branch {- format!(- "✅ {green}Created new worktree for {green_bold}{branch}{green_bold:#}{green:#}\n {dim}Path: {}{dim:#}",- path.display()- )- } else {- format!(- "✅ {green}Added worktree for {green_bold}{branch}{green_bold:#}{green:#}\n {dim}Path: {}{dim:#}",- path.display()- )- }- }- }-}--/// Handle output for a switch operation-///-/// In internal mode: outputs directives for shell wrapper-/// In non-internal mode: prints message and executes command-pub fn handle_switch_output(- result: &SwitchResult,- branch: &str,- execute: Option<&str>,- internal: bool,-) -> Result<(), GitError> {- if internal {- // Internal mode: output directives for shell wrapper- let mut output = DirectiveOutput::new();- output.add(Directive::ChangeDirectory(result.path().clone()));- output.add(Directive::Message(format_switch_message(result, branch)));-- if let Some(cmd) = execute {- output.add(Directive::Execute(cmd.to_string()));- }-- output- .write_to_stdout()- .map_err(|e| GitError::CommandFailed(e.to_string()))?;- } else {- // Non-internal mode: print message and execute command- println!("{}", format_switch_message(result, branch));-- if let Some(cmd) = execute {- // Execute command after showing message- println!();- execute_command_in_worktree(result.path(), cmd)?;- } else {- // Show shell integration hint if no command to execute- println!();- println!("{}", shell_integration_hint());- }- }-- Ok(())-}--/// Format a message for a remove operation-pub fn format_remove_message(result: &RemoveResult) -> String {- use anstyle::{AnsiColor, Color};- let green = AnstyleStyle::new().fg_color(Some(Color::Ansi(AnsiColor::Green)));- let green_bold = green.bold();-- match result {- RemoveResult::AlreadyOnDefault(branch) => {- format!(- "✅ {green}Already on default branch {green_bold}{branch}{green_bold:#}{green:#}"- )- }- RemoveResult::RemovedWorktree { primary_path } => {- let dim = AnstyleStyle::new().dimmed();- format!(- "✅ {green}Removed worktree and returned to primary{green:#}\n {dim}Path: {}{dim:#}",- primary_path.display()- )- }- RemoveResult::SwitchedToDefault(branch) => {- format!(- "✅ {green}Switched to default branch {green_bold}{branch}{green_bold:#}{green:#}"- )- }- }-}--/// Handle output for a remove operation-///-/// In internal mode: outputs directives for shell wrapper (only for RemovedWorktree)-/// In non-internal mode: prints message-pub fn handle_remove_output(result: &RemoveResult, internal: bool) -> Result<(), GitError> {- if internal {- // Internal mode: only RemovedWorktree needs a CD directive- if let RemoveResult::RemovedWorktree { primary_path } = result {- let mut output = DirectiveOutput::new();- output.add(Directive::ChangeDirectory(primary_path.clone()));- output.add(Directive::Message(format_remove_message(result)));-- output- .write_to_stdout()- .map_err(|e| GitError::CommandFailed(e.to_string()))?;- }- // Other cases don't need directives in internal mode- } else {- // Non-internal mode: print message and hint- println!("{}", format_remove_message(result));-- // Show shell integration hint for RemovedWorktree- if matches!(result, RemoveResult::RemovedWorktree { .. }) {- println!();- println!("{}", shell_integration_hint());- }- }-- Ok(())-}--/// Generate hint message for shell integration setup-pub fn shell_integration_hint() -> String {- if let Some(config_path) = Shell::is_integration_configured() {- format!(- "Shell integration configured. Restart your shell or run: source {}",- config_path.display()- )- } else {- "To enable automatic cd, run: wt configure-shell".to_string()- }-}--/// Execute a command in the given worktree directory-pub fn execute_command_in_worktree(worktree_path: &Path, command: &str) -> Result<(), GitError> {- #[cfg(target_os = "windows")]- let (shell, shell_arg) = ("cmd", "/C");- #[cfg(not(target_os = "windows"))]- let (shell, shell_arg) = ("sh", "-c");-- let status = std::process::Command::new(shell)- .arg(shell_arg)- .arg(command)- .current_dir(worktree_path)- .stdin(std::process::Stdio::inherit())- .stdout(std::process::Stdio::inherit())- .stderr(std::process::Stdio::inherit())- .status()- .map_err(|e| GitError::CommandFailed(format!("Failed to execute command: {}", e)))?;-- if !status.success() {- return Err(GitError::CommandFailed(format!(- "Command '{}' failed with exit code {}",- command,- status.code().unwrap_or(-1)- )));- }-- Ok(())-}diff --git a/src/output/directive.rs b/src/output/directive.rsnew file mode 100644index 000000000..1ff4e8ed6--- /dev/null+++ b/src/output/directive.rs@@ -0,0 +1,44 @@+//! Directive output mode for shell integration++use anstream::adapter::strip_str;+use std::io::{self, Write};+use std::path::Path;++/// Directive output mode for shell integration+///+/// Outputs NUL-terminated directives for shell wrapper to parse and execute.+pub struct DirectiveOutput;++impl DirectiveOutput {+ pub fn new() -> Self {+ Self+ }++ pub fn success(&mut self, message: String) -> io::Result<()> {+ let plain = strip_str(&message).to_string();+ write!(io::stdout(), "{}\0", plain)+ }++ pub fn change_directory(&mut self, path: &Path) -> io::Result<()> {+ write!(io::stdout(), "__WORKTRUNK_CD__{}\0", path.display())+ }++ pub fn execute(&mut self, command: String) -> io::Result<()> {+ write!(io::stdout(), "__WORKTRUNK_EXEC__{}\0", command)+ }++ pub fn flush(&mut self) -> io::Result<()> {+ writeln!(io::stdout())?;+ io::stdout().flush()+ }++ pub fn is_interactive(&self) -> bool {+ false+ }+}++impl Default for DirectiveOutput {+ fn default() -> Self {+ Self::new()+ }+}diff --git a/src/output/global.rs b/src/output/global.rsnew file mode 100644index 000000000..9ec74522a--- /dev/null+++ b/src/output/global.rs@@ -0,0 +1,123 @@+//! Global output context using thread-local storage+//!+//! This provides a logging-like API where you configure output mode once+//! at program start, then use it anywhere without passing parameters.+//!+//! # Implementation+//!+//! Uses `thread_local!` to store per-thread output state:+//! - Each thread gets its own `OUTPUT_CONTEXT`+//! - `RefCell<T>` enables interior mutability (runtime borrow checking)+//! - Enum dispatch avoids trait object overhead (static dispatch)+//!+//! # Trade-offs+//!+//! - ✅ Zero parameter threading - call from anywhere+//! - ✅ Single initialization point - set once in main()+//! - ✅ Fast access - thread-local is just a pointer lookup+//! - ⚠️ Per-thread state - not an issue for single-threaded CLI+//! - ⚠️ Runtime borrow checks - acceptable for this access pattern++use super::directive::DirectiveOutput;+use super::interactive::InteractiveOutput;+use std::cell::RefCell;+use std::io;+use std::path::Path;++/// Output mode selection+#[derive(Debug, Clone, Copy)]+pub enum OutputMode {+ Interactive,+ Directive,+}++/// Output handler - enum dispatch instead of trait object+enum OutputHandler {+ Interactive(InteractiveOutput),+ Directive(DirectiveOutput),+}++thread_local! {+ static OUTPUT_CONTEXT: RefCell<OutputHandler> = RefCell::new(+ OutputHandler::Interactive(InteractiveOutput::new())+ );+}++/// Initialize the global output context+///+/// Call this once at program startup to set the output mode.+pub fn initialize(mode: OutputMode) {+ let handler = match mode {+ OutputMode::Interactive => OutputHandler::Interactive(InteractiveOutput::new()),+ OutputMode::Directive => OutputHandler::Directive(DirectiveOutput::new()),+ };++ OUTPUT_CONTEXT.with(|ctx| {+ *ctx.borrow_mut() = handler;+ });+}++/// Emit a success message+pub fn success(message: impl Into<String>) -> io::Result<()> {+ OUTPUT_CONTEXT.with(|ctx| {+ let msg = message.into();+ match &mut *ctx.borrow_mut() {+ OutputHandler::Interactive(i) => i.success(msg),+ OutputHandler::Directive(d) => d.success(msg),+ }+ })+}++/// Request directory change (for shell integration)+pub fn change_directory(path: impl AsRef<Path>) -> io::Result<()> {+ OUTPUT_CONTEXT.with(|ctx| {+ let p = path.as_ref();+ match &mut *ctx.borrow_mut() {+ OutputHandler::Interactive(i) => i.change_directory(p),+ OutputHandler::Directive(d) => d.change_directory(p),+ }+ })+}++/// Request command execution+pub fn execute(command: impl Into<String>) -> io::Result<()> {+ OUTPUT_CONTEXT.with(|ctx| {+ let cmd = command.into();+ match &mut *ctx.borrow_mut() {+ OutputHandler::Interactive(i) => i.execute(cmd),+ OutputHandler::Directive(d) => d.execute(cmd),+ }+ })+}++/// Flush any buffered output+pub fn flush() -> io::Result<()> {+ OUTPUT_CONTEXT.with(|ctx| match &mut *ctx.borrow_mut() {+ OutputHandler::Interactive(i) => i.flush(),+ OutputHandler::Directive(d) => d.flush(),+ })+}++/// Check if interactive mode+pub fn is_interactive() -> bool {+ OUTPUT_CONTEXT.with(|ctx| match &*ctx.borrow() {+ OutputHandler::Interactive(i) => i.is_interactive(),+ OutputHandler::Directive(d) => d.is_interactive(),+ })+}++#[cfg(test)]+mod tests {+ use super::*;++ #[test]+ fn test_mode_switching() {+ // Default is interactive+ initialize(OutputMode::Interactive);+ assert!(is_interactive());++ // Switch to directive+ initialize(OutputMode::Directive);+ assert!(!is_interactive());+ }+}diff --git a/src/output/handlers.rs b/src/output/handlers.rsnew file mode 100644index 000000000..e9db98c37--- /dev/null+++ b/src/output/handlers.rs@@ -0,0 +1,140 @@+//! Output handlers for worktree operations using the global output context++use crate::commands::worktree::{RemoveResult, SwitchResult};+use worktrunk::git::GitError;+use worktrunk::styling::AnstyleStyle;++/// Format plain message for switch operation (no emoji - added by OutputContext)+fn format_switch_message_plain(result: &SwitchResult, branch: &str) -> String {+ let bold = AnstyleStyle::new().bold();++ match result {+ SwitchResult::ExistingWorktree(_) => {+ format!("Switched to worktree for {bold}{branch}{bold:#}")+ }+ SwitchResult::CreatedWorktree {+ path,+ created_branch,+ } => {+ let dim = AnstyleStyle::new().dimmed();+ if *created_branch {+ format!(+ "Created new worktree for {bold}{branch}{bold:#}\n {dim}Path: {}{dim:#}",+ path.display()+ )+ } else {+ format!(+ "Added worktree for {bold}{branch}{bold:#}\n {dim}Path: {}{dim:#}",+ path.display()+ )+ }+ }+ }+}++/// Format plain message for remove operation (no emoji - added by OutputContext)+fn format_remove_message_plain(result: &RemoveResult) -> String {+ let bold = AnstyleStyle::new().bold();+ let dim = AnstyleStyle::new().dimmed();++ match result {+ RemoveResult::AlreadyOnDefault(branch) => {+ format!("Already on default branch {bold}{branch}{bold:#}")+ }+ RemoveResult::RemovedWorktree { primary_path } => {+ format!(+ "Removed worktree, returned to primary\n {dim}Path: {}{dim:#}",+ primary_path.display()+ )+ }+ RemoveResult::SwitchedToDefault(branch) => {+ format!("Switched to default branch {bold}{branch}{bold:#}")+ }+ }+}++/// Shell integration hint message+fn shell_integration_hint() -> &'static str {+ "To enable automatic cd, run: wt configure-shell"+}++/// Handle output for a switch operation+pub fn handle_switch_output(+ result: &SwitchResult,+ branch: &str,+ execute: Option<&str>,+) -> Result<(), GitError> {+ // Set target directory for command execution+ super::change_directory(result.path()).map_err(|e| GitError::CommandFailed(e.to_string()))?;++ // Show success message (plain text - formatting added by OutputContext)+ super::success(format_switch_message_plain(result, branch))+ .map_err(|e| GitError::CommandFailed(e.to_string()))?;++ // Execute command if provided+ if let Some(cmd) = execute {+ super::execute(cmd).map_err(|e| GitError::CommandFailed(e.to_string()))?;+ } else if super::is_interactive() {+ // No execute command in interactive mode: show shell integration hint+ use worktrunk::styling::println;+ println!();+ println!("{}", shell_integration_hint());+ }++ // Flush output (important for directive mode)+ super::flush().map_err(|e| GitError::CommandFailed(e.to_string()))?;++ Ok(())+}++/// Handle output for a remove operation+pub fn handle_remove_output(result: &RemoveResult) -> Result<(), GitError> {+ // For removed worktree, set target directory for shell to cd to+ if let RemoveResult::RemovedWorktree { primary_path } = result {+ super::change_directory(primary_path)+ .map_err(|e| GitError::CommandFailed(e.to_string()))?;+ }++ // Show success message+ super::success(format_remove_message_plain(result))+ .map_err(|e| GitError::CommandFailed(e.to_string()))?;++ // Flush output+ super::flush().map_err(|e| GitError::CommandFailed(e.to_string()))?;++ Ok(())+}++/// Execute a command in a worktree directory+pub fn execute_command_in_worktree(+ worktree_path: &std::path::Path,+ command: &str,+) -> Result<(), GitError> {+ use std::process::Command;++ let output = Command::new("sh")+ .arg("-c")+ .arg(command)+ .current_dir(worktree_path)+ .output()+ .map_err(|e| GitError::CommandFailed(format!("Failed to execute command: {}", e)))?;++ if !output.status.success() {+ return Err(GitError::CommandFailed(format!(+ "Command failed with exit code: {}",+ output.status+ )));+ }++ // Print command output+ if !output.stdout.is_empty() {+ use worktrunk::styling::println;+ println!("{}", String::from_utf8_lossy(&output.stdout).trim_end());+ }+ if !output.stderr.is_empty() {+ use worktrunk::styling::eprintln;+ eprintln!("{}", String::from_utf8_lossy(&output.stderr).trim_end());+ }++ Ok(())+}diff --git a/src/output/interactive.rs b/src/output/interactive.rsnew file mode 100644index 000000000..1c52a644e--- /dev/null+++ b/src/output/interactive.rs@@ -0,0 +1,62 @@+//! Interactive output mode for human users++use anstyle::{AnsiColor, Color};+use std::io::{self, Write};+use std::path::Path;+use worktrunk::styling::{AnstyleStyle, println};++/// Interactive output mode for human users+///+/// Formats messages with colors, emojis, and formatting.+/// Executes commands directly instead of emitting directives.+pub struct InteractiveOutput {+ /// Target directory for command execution (set by change_directory)+ target_dir: Option<std::path::PathBuf>,+}++impl InteractiveOutput {+ pub fn new() -> Self {+ Self { target_dir: None }+ }++ pub fn success(&mut self, message: String) -> io::Result<()> {+ let green = AnstyleStyle::new().fg_color(Some(Color::Ansi(AnsiColor::Green)));+ println!("✅ {green}{message}{green:#}");+ Ok(())+ }++ pub fn change_directory(&mut self, path: &Path) -> io::Result<()> {+ // In interactive mode, we can't actually change directory+ // Just store the target for execute commands+ self.target_dir = Some(path.to_path_buf());+ Ok(())+ }++ pub fn execute(&mut self, command: String) -> io::Result<()> {+ // Execute command in the target directory+ let exec_dir = self+ .target_dir+ .as_ref()+ .map(|p| p.as_path())+ .unwrap_or_else(|| Path::new("."));++ crate::output::execute_command_in_worktree(exec_dir, &command)+ .map_err(|e| io::Error::new(io::ErrorKind::Other, e.to_string()))+ }++ pub fn flush(&mut self) -> io::Result<()> {+ io::stdout().flush()?;+ io::stderr().flush()?;+ Ok(())+ }++ pub fn is_interactive(&self) -> bool {+ true+ }+}++impl Default for InteractiveOutput {+ fn default() -> Self {+ Self::new()+ }+}diff --git a/src/output/mod.rs b/src/output/mod.rsnew file mode 100644index 000000000..61bdb18dd--- /dev/null+++ b/src/output/mod.rs@@ -0,0 +1,70 @@+//! Output and presentation layer for worktree commands.+//!+//! # Architecture+//!+//! Global context-based output system similar to logging frameworks (`log`, `tracing`).+//! Initialize once at program start with `initialize(OutputMode)`, then use+//! output functions anywhere: `success()`, `change_directory()`, `execute()`, etc.+//!+//! ## Design+//!+//! **Thread-local storage** stores the output handler globally:+//!+//! ```rust,ignore+//! thread_local! {+//! static OUTPUT_CONTEXT: RefCell<OutputHandler> = ...;+//! }+//! ```+//!+//! Each thread gets its own output context. `RefCell` provides interior mutability+//! for mutation through shared references (runtime borrow checking).+//!+//! **Enum dispatch** routes calls to the appropriate handler:+//!+//! ```rust,ignore+//! enum OutputHandler {+//! Interactive(InteractiveOutput), // Human-friendly with colors+//! Directive(DirectiveOutput), // Machine-readable for shell integration+//! }+//! ```+//!+//! This enables static dispatch and compiler optimizations.+//!+//! ## Usage Pattern+//!+//! ```rust,ignore+//! // 1. Initialize once in main()+//! let mode = if internal {+//! OutputMode::Directive+//! } else {+//! OutputMode::Interactive+//! };+//! output::initialize(mode);+//!+//! // 2. Use anywhere in the codebase+//! output::success("Operation complete");+//! output::change_directory(&path);+//! output::execute("git pull");+//! output::flush();+//! ```+//!+//! ## Output Modes+//!+//! - **Interactive**: Colors, emojis, shell hints, direct command execution+//! - **Directive**: Plain text with NUL-terminated directives for shell integration+//! - `__WORKTRUNK_CD__<path>\0` - Change directory+//! - `__WORKTRUNK_EXEC__<cmd>\0` - Execute command+//! - `<message>\0` - Success message++pub mod directive;+pub mod global;+pub mod handlers;+pub mod interactive;++// Re-export the public API+pub use global::{+ OutputMode, change_directory, execute, flush, initialize, is_interactive, success,+};++// Re-export output handlers+pub use handlers::{execute_command_in_worktree, handle_remove_output, handle_switch_output};diff --git a/tests/snapshots/integration__integration_tests__directives__merge_internal_keep.snap b/tests/snapshots/integration__integration_tests__directives__merge_internal_keep.snapindex 1810e0d24..a1f59d37f 100644Binary files a/tests/snapshots/integration__integration_tests__directives__merge_internal_keep.snap and b/tests/snapshots/integration__integration_tests__directives__merge_internal_keep.snap differdiff --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 64f55fd33..80d1a4cb1 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@@ -16,8 +16,8 @@ info:LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1704067200"- WORKTRUNK_LLM__ARGS: "fix: update file 1 content"- WORKTRUNK_LLM__COMMAND: echo+ WORKTRUNK_COMMIT_GENERATION__ARGS: "fix: update file 1 content"+ WORKTRUNK_COMMIT_GENERATION__COMMAND: echo---success: trueexit_code: 0@@ -37,15 +37,13 @@ exit_code: 0✅ [32mPushed to [1m[32mmain[0m (1 commit, 2 files, [32m+2[0m) [0m🔄 [36mCleaning up worktree...[0m-✅ [32mRemoved worktree and returned to primary[0m- [2mPath: [REPO][0m+✅ [32mRemoved worktree, returned to primary+ [2mPath: [REPO][0m[0m-To enable automatic cd, run: wt configure-shell+✅ [32mMerge complete-✅ [32mMerge complete[0m-- [2mMerged: [1m[32mfeature[0m → [1m[32mmain[0m[0m+ [2mMerged: [1mfeature[0m → [1mmain[0m[0m[2mSquashed: 3 commits into 1[0m- [2mWorktree: Removed[0m+ [2mWorktree: Removed[0m[0m----- stderr -----diff --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 65f87582b..7f09cccb9 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@@ -32,14 +32,12 @@ exit_code: 0✅ [32mPushed to [1m[32mmain[0m (2 commits, 1 file, [32m+1[0m) [0m🔄 [36mCleaning up worktree...[0m-✅ [32mRemoved worktree and returned to primary[0m- [2mPath: [REPO][0m+✅ [32mRemoved worktree, returned to primary+ [2mPath: [REPO][0m[0m-To enable automatic cd, run: wt configure-shell+✅ [32mMerge complete-✅ [32mMerge complete[0m-- [2mMerged: [1m[32mfeature[0m → [1m[32mmain[0m[0m- [2mWorktree: Removed[0m+ [2mMerged: [1mfeature[0m → [1mmain[0m[0m+ [2mWorktree: Removed[0m[0m----- stderr -----diff --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 e7637b1b7..7c9d9a25b 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@@ -15,8 +15,8 @@ info:LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1704067200"- WORKTRUNK_LLM__ARGS: "fix: improve auth validation logic"- WORKTRUNK_LLM__COMMAND: echo+ WORKTRUNK_COMMIT_GENERATION__ARGS: "fix: improve auth validation logic"+ WORKTRUNK_COMMIT_GENERATION__COMMAND: echo---success: trueexit_code: 0@@ -34,14 +34,12 @@ exit_code: 0✅ [32mPushed to [1m[32mmain[0m (2 commits, 1 file, [32m+1[0m) [0m🔄 [36mCleaning up worktree...[0m-✅ [32mRemoved worktree and returned to primary[0m- [2mPath: [REPO][0m+✅ [32mRemoved worktree, returned to primary+ [2mPath: [REPO][0m[0m-To enable automatic cd, run: wt configure-shell+✅ [32mMerge complete-✅ [32mMerge complete[0m-- [2mMerged: [1m[32mfeature[0m → [1m[32mmain[0m[0m- [2mWorktree: Removed[0m+ [2mMerged: [1mfeature[0m → [1mmain[0m[0m+ [2mWorktree: Removed[0m[0m----- stderr -----diff --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 4111c28cf..37cf76f81 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@@ -17,8 +17,8 @@ info:LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1704067200"- WORKTRUNK_LLM__ARGS: "feat: complete user dashboard"- WORKTRUNK_LLM__COMMAND: echo+ WORKTRUNK_COMMIT_GENERATION__ARGS: "feat: complete user dashboard"+ WORKTRUNK_COMMIT_GENERATION__COMMAND: echo---success: trueexit_code: 0@@ -36,14 +36,12 @@ exit_code: 0✅ [32mPushed to [1m[32mmain[0m (2 commits, 1 file, [32m+1[0m) [0m🔄 [36mCleaning up worktree...[0m-✅ [32mRemoved worktree and returned to primary[0m- [2mPath: [REPO][0m+✅ [32mRemoved worktree, returned to primary+ [2mPath: [REPO][0m[0m-To enable automatic cd, run: wt configure-shell+✅ [32mMerge complete-✅ [32mMerge complete[0m-- [2mMerged: [1m[32mfeature[0m → [1m[32mmain[0m[0m- [2mWorktree: Removed[0m+ [2mMerged: [1mfeature[0m → [1mmain[0m[0m+ [2mWorktree: Removed[0m[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__merge__merge_fast_forward.snap b/tests/snapshots/integration__integration_tests__merge__merge_fast_forward.snapindex 6badecad1..103920ad8 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_fast_forward.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_fast_forward.snap@@ -29,14 +29,12 @@ exit_code: 0✅ [32mPushed to [1m[32mmain[0m (1 commit, 1 file, [32m+1[0m) [0m🔄 [36mCleaning up worktree...[0m-✅ [32mRemoved worktree and returned to primary[0m- [2mPath: [REPO][0m+✅ [32mRemoved worktree, returned to primary+ [2mPath: [REPO][0m[0m-To enable automatic cd, run: wt configure-shell+✅ [32mMerge complete-✅ [32mMerge complete[0m-- [2mMerged: [1m[32mfeature[0m → [1m[32mmain[0m[0m- [2mWorktree: Removed[0m+ [2mMerged: [1mfeature[0m → [1mmain[0m[0m+ [2mWorktree: Removed[0m[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__merge__merge_not_fast_forward.snap b/tests/snapshots/integration__integration_tests__merge__merge_not_fast_forward.snapindex 4b19e90d7..474a79e01 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_not_fast_forward.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_not_fast_forward.snap@@ -29,14 +29,12 @@ exit_code: 0✅ [32mPushed to [1m[32mmain[0m (1 commit, 1 file, [32m+1[0m) [0m🔄 [36mCleaning up worktree...[0m-✅ [32mRemoved worktree and returned to primary[0m- [2mPath: [REPO][0m+✅ [32mRemoved worktree, returned to primary+ [2mPath: [REPO][0m[0m-To enable automatic cd, run: wt configure-shell+✅ [32mMerge complete-✅ [32mMerge complete[0m-- [2mMerged: [1m[32mfeature[0m → [1m[32mmain[0m[0m- [2mWorktree: Removed[0m+ [2mMerged: [1mfeature[0m → [1mmain[0m[0m+ [2mWorktree: Removed[0m[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_failure.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_failure.snapindex a8def8be7..c240a1332 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_failure.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_failure.snap@@ -26,6 +26,6 @@ exit_code: 1❌ [31mPre-merge check failed: [1m[31mcmd[0m[0m- Command 'exit 1' failed with exit code 1+ Command failed with exit code: exit status: 1💡 [2mUse --no-verify to skip pre-merge checks[0mdiff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_named.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_named.snapindex 6bda1fd6a..ceba19506 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_named.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_named.snap@@ -33,14 +33,12 @@ exit_code: 0✅ [32mPushed to [1m[32mmain[0m (1 commit, 1 file, [32m+1[0m) [0m🔄 [36mCleaning up worktree...[0m-✅ [32mRemoved worktree and returned to primary[0m- [2mPath: [REPO][0m+✅ [32mRemoved worktree, returned to primary+ [2mPath: [REPO][0m[0m-To enable automatic cd, run: wt configure-shell+✅ [32mMerge complete-✅ [32mMerge complete[0m-- [2mMerged: [1m[32mfeature[0m → [1m[32mmain[0m[0m- [2mWorktree: Removed[0m+ [2mMerged: [1mfeature[0m → [1mmain[0m[0m+ [2mWorktree: Removed[0m[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_no_verify.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_no_verify.snapindex bd0cbea25..cf0118447 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_no_verify.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_no_verify.snap@@ -30,14 +30,12 @@ exit_code: 0✅ [32mPushed to [1m[32mmain[0m (1 commit, 1 file, [32m+1[0m) [0m🔄 [36mCleaning up worktree...[0m-✅ [32mRemoved worktree and returned to primary[0m- [2mPath: [REPO][0m+✅ [32mRemoved worktree, returned to primary+ [2mPath: [REPO][0m[0m-To enable automatic cd, run: wt configure-shell+✅ [32mMerge complete-✅ [32mMerge complete[0m-- [2mMerged: [1m[32mfeature[0m → [1m[32mmain[0m[0m- [2mWorktree: Removed[0m+ [2mMerged: [1mfeature[0m → [1mmain[0m[0m+ [2mWorktree: Removed[0m[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_success.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_success.snapindex 2577c824f..62cb216c3 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_success.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_merge_check_success.snap@@ -31,14 +31,12 @@ exit_code: 0✅ [32mPushed to [1m[32mmain[0m (1 commit, 1 file, [32m+1[0m) [0m🔄 [36mCleaning up worktree...[0m-✅ [32mRemoved worktree and returned to primary[0m- [2mPath: [REPO][0m+✅ [32mRemoved worktree, returned to primary+ [2mPath: [REPO][0m[0m-To enable automatic cd, run: wt configure-shell+✅ [32mMerge complete-✅ [32mMerge complete[0m-- [2mMerged: [1m[32mfeature[0m → [1m[32mmain[0m[0m- [2mWorktree: Removed[0m+ [2mMerged: [1mfeature[0m → [1mmain[0m[0m+ [2mWorktree: Removed[0m[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__merge__merge_squash_deterministic.snap b/tests/snapshots/integration__integration_tests__merge__merge_squash_deterministic.snapindex 882737c71..e3eb89577 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_squash_deterministic.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_squash_deterministic.snap@@ -34,15 +34,13 @@ exit_code: 0✅ [32mPushed to [1m[32mmain[0m (1 commit, 3 files, [32m+3[0m) [0m🔄 [36mCleaning up worktree...[0m-✅ [32mRemoved worktree and returned to primary[0m- [2mPath: [REPO][0m+✅ [32mRemoved worktree, returned to primary+ [2mPath: [REPO][0m[0m-To enable automatic cd, run: wt configure-shell+✅ [32mMerge complete-✅ [32mMerge complete[0m-- [2mMerged: [1m[32mfeature[0m → [1m[32mmain[0m[0m+ [2mMerged: [1mfeature[0m → [1mmain[0m[0m[2mSquashed: 3 commits into 1[0m- [2mWorktree: Removed[0m+ [2mWorktree: Removed[0m[0m----- stderr -----diff --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 79775bffb..4de1a2b3b 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@@ -16,7 +16,7 @@ info:LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1704067200"- WORKTRUNK_LLM__COMMAND: nonexistent-llm-command+ WORKTRUNK_COMMIT_GENERATION__COMMAND: nonexistent-llm-command---success: trueexit_code: 0@@ -34,15 +34,13 @@ exit_code: 0✅ [32mPushed to [1m[32mmain[0m (1 commit, 2 files, [32m+2[0m) [0m🔄 [36mCleaning up worktree...[0m-✅ [32mRemoved worktree and returned to primary[0m- [2mPath: [REPO][0m+✅ [32mRemoved worktree, returned to primary+ [2mPath: [REPO][0m[0m-To enable automatic cd, run: wt configure-shell+✅ [32mMerge complete-✅ [32mMerge complete[0m-- [2mMerged: [1m[32mfeature[0m → [1m[32mmain[0m[0m+ [2mMerged: [1mfeature[0m → [1mmain[0m[0m[2mSquashed: 2 commits into 1[0m- [2mWorktree: Removed[0m+ [2mWorktree: Removed[0m[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__merge__merge_squash_single_commit.snap b/tests/snapshots/integration__integration_tests__merge__merge_squash_single_commit.snapindex b981e014b..287ae3d07 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_squash_single_commit.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_squash_single_commit.snap@@ -31,14 +31,12 @@ exit_code: 0✅ [32mPushed to [1m[32mmain[0m (1 commit, 1 file, [32m+1[0m) [0m🔄 [36mCleaning up worktree...[0m-✅ [32mRemoved worktree and returned to primary[0m- [2mPath: [REPO][0m+✅ [32mRemoved worktree, returned to primary+ [2mPath: [REPO][0m[0m-To enable automatic cd, run: wt configure-shell+✅ [32mMerge complete-✅ [32mMerge complete[0m-- [2mMerged: [1m[32mfeature[0m → [1m[32mmain[0m[0m- [2mWorktree: Removed[0m+ [2mMerged: [1mfeature[0m → [1mmain[0m[0m+ [2mWorktree: Removed[0m[0m----- stderr -----diff --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 ff888fcef..dd9bbe158 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@@ -16,9 +16,9 @@ info:LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1704067200"- WORKTRUNK_LLM__ARGS__0: "-c"- WORKTRUNK_LLM__ARGS__1: "cat >/dev/null && echo 'feat: implement user authentication system'"- WORKTRUNK_LLM__COMMAND: sh+ 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---success: trueexit_code: 0@@ -35,15 +35,13 @@ exit_code: 0✅ [32mPushed to [1m[32mmain[0m (1 commit, 1 file, [32m+1[0m) [0m🔄 [36mCleaning up worktree...[0m-✅ [32mRemoved worktree and returned to primary[0m- [2mPath: [REPO][0m+✅ [32mRemoved worktree, returned to primary+ [2mPath: [REPO][0m[0m-To enable automatic cd, run: wt configure-shell+✅ [32mMerge complete-✅ [32mMerge complete[0m-- [2mMerged: [1m[32mfeature[0m → [1m[32mmain[0m[0m+ [2mMerged: [1mfeature[0m → [1mmain[0m[0m[2mSquashed: 2 commits into 1[0m- [2mWorktree: Removed[0m+ [2mWorktree: Removed[0m[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__merge__merge_to_default.snap b/tests/snapshots/integration__integration_tests__merge__merge_to_default.snapindex 890450ef8..12666fdcc 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_to_default.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_to_default.snap@@ -28,14 +28,12 @@ exit_code: 0✅ [32mPushed to [1m[32mmain[0m (1 commit, 1 file, [32m+1[0m) [0m🔄 [36mCleaning up worktree...[0m-✅ [32mRemoved worktree and returned to primary[0m- [2mPath: [REPO][0m+✅ [32mRemoved worktree, returned to primary+ [2mPath: [REPO][0m[0m-To enable automatic cd, run: wt configure-shell+✅ [32mMerge complete-✅ [32mMerge complete[0m-- [2mMerged: [1m[32mfeature[0m → [1m[32mmain[0m[0m- [2mWorktree: Removed[0m+ [2mMerged: [1mfeature[0m → [1mmain[0m[0m+ [2mWorktree: Removed[0m[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__merge__merge_with_keep.snap b/tests/snapshots/integration__integration_tests__merge__merge_with_keep.snapindex 4037f58a1..170b8f8ac 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_with_keep.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_with_keep.snap@@ -30,9 +30,9 @@ exit_code: 0✅ [32mPushed to [1m[32mmain[0m (1 commit, 1 file, [32m+1[0m) [0m-✅ [32mMerge complete[0m+✅ [32mMerge complete- [2mMerged: [1m[32mfeature[0m → [1m[32mmain[0m[0m- [2mWorktree: Kept (use 'wt remove' to clean up)[0m+ [2mMerged: [1mfeature[0m → [1mmain[0m[0m+ [2mWorktree: Kept (use 'wt remove' to clean up)[0m[0m----- stderr -----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.snapindex c15b61d36..4468b203c 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,7 +13,7 @@ info:GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/nullGIT_EDITOR: ""- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpKHkSRe+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpUuZGl5LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1704067200"@@ -21,13 +21,23 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mCreated new worktree for [1m[32mfeature[0m[0m- [2mPath: [REPO]/../test-repo.feature[0m+✅ [32mCreated new worktree for [1mfeature[0m+ [2mPath: [REPO]/../test-repo.feature[0m[0mTo enable automatic cd, run: wt configure-shell----- stderr ------🔄 [36mExecuting (post-create):[0m++🟡 [33mPermission required to execute in worktree[0m++[1mtest-repo[0m ([2mtest-repo[0m) wants to execute:[40m [0m echo 'Setup done' > setup.txt-🔄 [36mStarting (background): sleep 0.5 && echo 'Server running' > server.txt[0m- [2m→ Logs: .git/wt-logs/post-start-[NAME]-[TIMESTAMP].log[0m++💡 Allow and remember? [1m[y/N][0m [2mSkipping command: echo 'Setup done' > setup.txt[0m++🟡 [33mPermission required to execute in worktree[0m++[1mtest-repo[0m ([2mtest-repo[0m) wants to execute:+[40m [0m sleep 0.5 && echo 'Server running' > server.txt++💡 Allow and remember? [1m[y/N][0m [2mSkipping command: sleep 0.5 && echo 'Server running' > server.txt[0mdiff --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 0a5069243..5c1c55545 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@@ -15,7 +15,7 @@ info:GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/nullGIT_EDITOR: ""- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpyp4YON+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmptZb4PsLANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1704067200"@@ -23,10 +23,14 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mCreated new worktree for [1m[32mfeature[0m[0m- [2mPath: [REPO]/../test-repo.feature[0m-+✅ [32mCreated new worktree for [1mfeature[0m+ [2mPath: [REPO]/../test-repo.feature[0m[0m----- stderr ------🔄 [36mStarting (background): echo 'Background task' > background.txt[0m- [2m→ Logs: .git/wt-logs/post-start-[NAME]-[TIMESTAMP].log[0m++🟡 [33mPermission required to execute in worktree[0m++[1mtest-repo[0m ([2mtest-repo[0m) wants to execute:+[40m [0m echo 'Background task' > background.txt++💡 Allow and remember? [1m[y/N][0m [2mSkipping command: echo 'Background task' > background.txt[0mdiff --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 e9c2e8adc..2d56c21e9 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@@ -13,7 +13,7 @@ info:GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/nullGIT_EDITOR: ""- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpnLywt9+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpF1umrWLANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1704067200"@@ -21,12 +21,16 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mCreated new worktree for [1m[32mfeature[0m[0m- [2mPath: [REPO]/../test-repo.feature[0m+✅ [32mCreated new worktree for [1mfeature[0m+ [2mPath: [REPO]/../test-repo.feature[0m[0mTo enable automatic cd, run: wt configure-shell----- stderr ------🔄 [36mExecuting (post-create):[0m++🟡 [33mPermission required to execute in worktree[0m++[1mtest-repo[0m ([2mtest-repo[0m) wants to execute:[40m [0m exit 1-🟡 [33mCommand [1m[33mcmd[0m failed: Command 'exit 1' failed with exit code 1[0m++💡 Allow and remember? [1m[y/N][0m [2mSkipping command: exit 1[0mdiff --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 4fda35dac..42ca631e8 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,7 +13,7 @@ info:GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/nullGIT_EDITOR: ""- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp0uygJv+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpU051MHLANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1704067200"@@ -21,15 +21,23 @@ info:success: trueexit_code: 0----- stdout ------First-Second-✅ [32mCreated new worktree for [1m[32mfeature[0m[0m- [2mPath: [REPO]/../test-repo.feature[0m+✅ [32mCreated new worktree for [1mfeature[0m+ [2mPath: [REPO]/../test-repo.feature[0m[0mTo enable automatic cd, run: wt configure-shell----- stderr ------🔄 [36mExecuting (post-create):[0m++🟡 [33mPermission required to execute in worktree[0m++[1mtest-repo[0m ([2mtest-repo[0m) wants to execute:[40m [0m echo 'First'-🔄 [36mExecuting (post-create):[0m++💡 Allow and remember? [1m[y/N][0m [2mSkipping command: echo 'First'[0m++🟡 [33mPermission required to execute in worktree[0m++[1mtest-repo[0m ([2mtest-repo[0m) wants to execute:[40m [0m echo 'Second'++💡 Allow and remember? [1m[y/N][0m [2mSkipping command: echo 'Second'[0mdiff --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 53da6c1ed..f8a1983ca 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,7 +13,7 @@ info:GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/nullGIT_EDITOR: ""- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpfRJrjF+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpYddzNMLANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1704067200"@@ -21,15 +21,23 @@ info:success: trueexit_code: 0----- stdout ------Installing deps-Running setup-✅ [32mCreated new worktree for [1m[32mfeature[0m[0m- [2mPath: [REPO]/../test-repo.feature[0m+✅ [32mCreated new worktree for [1mfeature[0m+ [2mPath: [REPO]/../test-repo.feature[0m[0mTo enable automatic cd, run: wt configure-shell----- stderr ------🔄 [36mExecuting (post-create):[0m++🟡 [33mPermission required to execute in worktree[0m++[1mtest-repo[0m ([2mtest-repo[0m) wants to execute:[40m [0m echo 'Installing deps'-🔄 [36mExecuting (post-create):[0m++💡 Allow and remember? [1m[y/N][0m [2mSkipping command: echo 'Installing deps'[0m++🟡 [33mPermission required to execute in worktree[0m++[1mtest-repo[0m ([2mtest-repo[0m) wants to execute:[40m [0m echo 'Running setup'++💡 Allow and remember? [1m[y/N][0m [2mSkipping command: echo 'Running setup'[0mdiff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_no_config.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_no_config.snapindex 17ed5284f..ac8530bca 100644--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_no_config.snap+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_no_config.snap@@ -20,8 +20,8 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mCreated new worktree for [1m[32mfeature[0m[0m- [2mPath: [REPO]/../test-repo.feature[0m+✅ [32mCreated new worktree for [1mfeature[0m+ [2mPath: [REPO]/../test-repo.feature[0m[0mTo enable automatic cd, run: wt configure-shelldiff --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 4f3f61a66..80bbd1517 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@@ -13,7 +13,7 @@ info:GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/nullGIT_EDITOR: ""- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpCIH1Ds+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpYozSFbLANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1704067200"@@ -21,12 +21,16 @@ info:success: trueexit_code: 0----- stdout ------Setup complete-✅ [32mCreated new worktree for [1m[32mfeature[0m[0m- [2mPath: [REPO]/../test-repo.feature[0m+✅ [32mCreated new worktree for [1mfeature[0m+ [2mPath: [REPO]/../test-repo.feature[0m[0mTo enable automatic cd, run: wt configure-shell----- stderr ------🔄 [36mExecuting (post-create):[0m++🟡 [33mPermission required to execute in worktree[0m++[1mtest-repo[0m ([2mtest-repo[0m) wants to execute:[40m [0m echo 'Setup complete'++💡 Allow and remember? [1m[y/N][0m [2mSkipping command: echo 'Setup complete'[0mdiff --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 637065996..ba6ccc13a 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,7 +13,7 @@ info:GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/nullGIT_EDITOR: ""- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpWzrP13+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpM4oDJlLANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1704067200"@@ -21,8 +21,8 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mCreated new worktree for [1m[32mfeature/test[0m[0m- [2mPath: [REPO]/../test-repo.feature-test[0m+✅ [32mCreated new worktree for [1mfeature/test[0m+ [2mPath: [REPO]/../test-repo.feature-test[0m[0mTo enable automatic cd, run: wt configure-shelldiff --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 ca8491f42..a98593c99 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@@ -13,7 +13,7 @@ info:GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/nullGIT_EDITOR: ""- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpAjLGDp+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpJdNF1sLANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1704067200"@@ -21,13 +21,20 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mCreated new worktree for [1m[32mfeature[0m[0m- [2mPath: [REPO]/../test-repo.feature[0m+✅ [32mCreated new worktree for [1mfeature[0m+ [2mPath: [REPO]/../test-repo.feature[0m[0mTo enable automatic cd, run: wt configure-shell----- stderr ------🔄 [36mStarting (background): echo 'line1++🟡 [33mPermission required to execute in worktree[0m++[1mtest-repo[0m ([2mtest-repo[0m) wants to execute:+[40m [0m echo 'line1+[40m [0m line2+[40m [0m line3' | grep line2 > filtered.txt++💡 Allow and remember? [1m[y/N][0m [2mSkipping command: echo 'line1line2line3' | grep line2 > filtered.txt[0m- [2m→ Logs: .git/wt-logs/post-start-[NAME]-[TIMESTAMP].log[0mdiff --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 0797e1aa2..de2ec6530 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@@ -13,7 +13,7 @@ info:GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/nullGIT_EDITOR: ""- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpsrsqrn+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpuSHM2tLANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1704067200"@@ -21,11 +21,16 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mCreated new worktree for [1m[32mfeature[0m[0m- [2mPath: [REPO]/../test-repo.feature[0m+✅ [32mCreated new worktree for [1mfeature[0m+ [2mPath: [REPO]/../test-repo.feature[0m[0mTo enable automatic cd, run: wt configure-shell----- stderr ------🔄 [36mStarting (background): echo 'unclosed quote[0m- [2m→ Logs: .git/wt-logs/post-start-[NAME]-[TIMESTAMP].log[0m++🟡 [33mPermission required to execute in worktree[0m++[1mtest-repo[0m ([2mtest-repo[0m) wants to execute:+[40m [0m echo 'unclosed quote++💡 Allow and remember? [1m[y/N][0m [2mSkipping command: echo 'unclosed quote[0mdiff --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 5a73a461a..829c5738d 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@@ -13,7 +13,7 @@ info:GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/nullGIT_EDITOR: ""- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpmm81Ut+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpU4gfUfLANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1704067200"@@ -21,11 +21,16 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mCreated new worktree for [1m[32mfeature[0m[0m- [2mPath: [REPO]/../test-repo.feature[0m+✅ [32mCreated new worktree for [1mfeature[0m+ [2mPath: [REPO]/../test-repo.feature[0m[0mTo enable automatic cd, run: wt configure-shell----- stderr ------🔄 [36mStarting (background): echo 'stdout output' && echo 'stderr output' >&2[0m- [2m→ Logs: .git/wt-logs/post-start-[NAME]-[TIMESTAMP].log[0m++🟡 [33mPermission required to execute in worktree[0m++[1mtest-repo[0m ([2mtest-repo[0m) wants to execute:+[40m [0m echo 'stdout output' && echo 'stderr output' >&2++💡 Allow and remember? [1m[y/N][0m [2mSkipping command: echo 'stdout output' && echo 'stderr output' >&2[0mdiff --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 348140588..22b3311a1 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,7 +13,7 @@ info:GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/nullGIT_EDITOR: ""- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpsJq5hm+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpqq16nlLANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1704067200"@@ -21,13 +21,23 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mCreated new worktree for [1m[32mfeature[0m[0m- [2mPath: [REPO]/../test-repo.feature[0m+✅ [32mCreated new worktree for [1mfeature[0m+ [2mPath: [REPO]/../test-repo.feature[0m[0mTo enable automatic cd, run: wt configure-shell----- stderr ------🔄 [36mStarting (background): echo 'Task 1 running' > task1.txt[0m- [2m→ Logs: .git/wt-logs/post-start-[NAME]-[TIMESTAMP].log[0m-🔄 [36mStarting (background): echo 'Task 2 running' > task2.txt[0m- [2m→ Logs: .git/wt-logs/post-start-[NAME]-[TIMESTAMP].log[0m++🟡 [33mPermission required to execute in worktree[0m++[1mtest-repo[0m ([2mtest-repo[0m) wants to execute:+[40m [0m echo 'Task 1 running' > task1.txt++💡 Allow and remember? [1m[y/N][0m [2mSkipping command: echo 'Task 1 running' > task1.txt[0m++🟡 [33mPermission required to execute in worktree[0m++[1mtest-repo[0m ([2mtest-repo[0m) wants to execute:+[40m [0m echo 'Task 2 running' > task2.txt++💡 Allow and remember? [1m[y/N][0m [2mSkipping command: echo 'Task 2 running' > task2.txt[0mdiff --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 72133a89c..a8b8f46ea 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,7 +13,7 @@ info:GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/nullGIT_EDITOR: ""- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpsJ7hwP+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpYgkgiZLANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1704067200"@@ -21,15 +21,30 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mCreated new worktree for [1m[32mfeature[0m[0m- [2mPath: [REPO]/../test-repo.feature[0m+✅ [32mCreated new worktree for [1mfeature[0m+ [2mPath: [REPO]/../test-repo.feature[0m[0mTo enable automatic cd, run: wt configure-shell----- stderr ------🔄 [36mStarting (background): echo 'TASK1_OUTPUT'[0m- [2m→ Logs: .git/wt-logs/post-start-[NAME]-[TIMESTAMP].log[0m-🔄 [36mStarting (background): echo 'TASK2_OUTPUT'[0m- [2m→ Logs: .git/wt-logs/post-start-[NAME]-[TIMESTAMP].log[0m-🔄 [36mStarting (background): echo 'TASK3_OUTPUT'[0m- [2m→ Logs: .git/wt-logs/post-start-[NAME]-[TIMESTAMP].log[0m++🟡 [33mPermission required to execute in worktree[0m++[1mtest-repo[0m ([2mtest-repo[0m) wants to execute:+[40m [0m echo 'TASK1_OUTPUT'++💡 Allow and remember? [1m[y/N][0m [2mSkipping command: echo 'TASK1_OUTPUT'[0m++🟡 [33mPermission required to execute in worktree[0m++[1mtest-repo[0m ([2mtest-repo[0m) wants to execute:+[40m [0m echo 'TASK2_OUTPUT'++💡 Allow and remember? [1m[y/N][0m [2mSkipping command: echo 'TASK2_OUTPUT'[0m++🟡 [33mPermission required to execute in worktree[0m++[1mtest-repo[0m ([2mtest-repo[0m) wants to execute:+[40m [0m echo 'TASK3_OUTPUT'++💡 Allow and remember? [1m[y/N][0m [2mSkipping command: echo 'TASK3_OUTPUT'[0mdiff --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 85b9c71d4..a919ee568 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@@ -13,7 +13,7 @@ info:GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/nullGIT_EDITOR: ""- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpeoYZa6+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp04jzX0LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1704067200"@@ -21,11 +21,16 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mCreated new worktree for [1m[32mfeature[0m[0m- [2mPath: [REPO]/../test-repo.feature[0m+✅ [32mCreated new worktree for [1mfeature[0m+ [2mPath: [REPO]/../test-repo.feature[0m[0mTo enable automatic cd, run: wt configure-shell----- stderr ------🔄 [36mStarting (background): sleep 1 && echo 'Background task done' > background.txt[0m- [2m→ Logs: .git/wt-logs/post-start-[NAME]-[TIMESTAMP].log[0m++🟡 [33mPermission required to execute in worktree[0m++[1mtest-repo[0m ([2mtest-repo[0m) wants to execute:+[40m [0m sleep 1 && echo 'Background task done' > background.txt++💡 Allow and remember? [1m[y/N][0m [2mSkipping command: sleep 1 && echo 'Background task done' > background.txt[0mdiff --git a/tests/snapshots/integration__integration_tests__remove__remove_already_on_default.snap b/tests/snapshots/integration__integration_tests__remove__remove_already_on_default.snapindex dac8e8361..cacbe3789 100644--- a/tests/snapshots/integration__integration_tests__remove__remove_already_on_default.snap+++ b/tests/snapshots/integration__integration_tests__remove__remove_already_on_default.snap@@ -18,6 +18,6 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mAlready on default branch [1m[32mmain[0m[0m+✅ [32mAlready on default branch [1mmain[0m[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__remove__remove_from_worktree.snap b/tests/snapshots/integration__integration_tests__remove__remove_from_worktree.snapindex 19e72d14a..3033e34d3 100644--- a/tests/snapshots/integration__integration_tests__remove__remove_from_worktree.snap+++ b/tests/snapshots/integration__integration_tests__remove__remove_from_worktree.snap@@ -18,9 +18,7 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mRemoved worktree and returned to primary[0m- [2mPath: [REPO][0m--To enable automatic cd, run: wt configure-shell+✅ [32mRemoved worktree, returned to primary+ [2mPath: [REPO][0m[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__remove__remove_internal_mode.snap b/tests/snapshots/integration__integration_tests__remove__remove_internal_mode.snapindex 3d43ecf74..f384a42c7 100644Binary files a/tests/snapshots/integration__integration_tests__remove__remove_internal_mode.snap and b/tests/snapshots/integration__integration_tests__remove__remove_internal_mode.snap differdiff --git a/tests/snapshots/integration__integration_tests__remove__remove_switch_to_default.snap b/tests/snapshots/integration__integration_tests__remove__remove_switch_to_default.snapindex 09cfca0a5..2ef55887d 100644--- a/tests/snapshots/integration__integration_tests__remove__remove_switch_to_default.snap+++ b/tests/snapshots/integration__integration_tests__remove__remove_switch_to_default.snap@@ -18,6 +18,6 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mSwitched to default branch [1m[32mmain[0m[0m+✅ [32mSwitched to default branch [1mmain[0m[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__switch__switch_base_without_create.snap b/tests/snapshots/integration__integration_tests__switch__switch_base_without_create.snapindex 2f7565116..8c3dbd906 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_base_without_create.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_base_without_create.snap@@ -21,7 +21,7 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mSwitched to worktree for [1m[32mmain[0m[0m+✅ [32mSwitched to worktree for [1mmain[0m[0mTo enable automatic cd, run: wt configure-shelldiff --git a/tests/snapshots/integration__integration_tests__switch__switch_create_new.snap b/tests/snapshots/integration__integration_tests__switch__switch_create_new.snapindex 9d2df18be..3fc455777 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_create_new.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_create_new.snap@@ -20,8 +20,8 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mCreated new worktree for [1m[32mfeature-x[0m[0m- [2mPath: [REPO]/../test-repo.feature-x[0m+✅ [32mCreated new worktree for [1mfeature-x[0m+ [2mPath: [REPO]/../test-repo.feature-x[0m[0mTo enable automatic cd, run: wt configure-shelldiff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_creates_file.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_creates_file.snapindex 9674fdc59..ac995c2cf 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_creates_file.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_creates_file.snap@@ -22,8 +22,7 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mCreated new worktree for [1m[32mfile-test[0m[0m- [2mPath: [REPO]/../test-repo.file-test[0m-+✅ [32mCreated new worktree for [1mfile-test[0m+ [2mPath: [REPO]/../test-repo.file-test[0m[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_existing.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_existing.snapindex cd0a72c3f..27f0c5cbc 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_existing.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_existing.snap@@ -21,7 +21,6 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mSwitched to worktree for [1m[32mexisting-exec[0m[0m-+✅ [32mSwitched to worktree for [1mexisting-exec[0m[0m----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_failure.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_failure.snapindex 1b4998f34..25ad57e6d 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_failure.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_failure.snap@@ -22,9 +22,8 @@ info:success: falseexit_code: 1----- stdout ------✅ [32mCreated new worktree for [1m[32mfail-test[0m[0m- [2mPath: [REPO]/../test-repo.fail-test[0m-+✅ [32mCreated new worktree for [1mfail-test[0m+ [2mPath: [REPO]/../test-repo.fail-test[0m[0m----- stderr ------Command 'exit 1' failed with exit code 1+Command failed with exit code: exit status: 1diff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_multiline.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_multiline.snapindex adb5ba753..cf3113752 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_multiline.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_multiline.snap@@ -22,9 +22,8 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mCreated new worktree for [1m[32mmultiline-test[0m[0m- [2mPath: [REPO]/../test-repo.multiline-test[0m-+✅ [32mCreated new worktree for [1mmultiline-test[0m+ [2mPath: [REPO]/../test-repo.multiline-test[0m[0mline1line2line3diff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_success.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_success.snapindex 58c8e94ee..52a9e382b 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_success.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_success.snap@@ -22,9 +22,8 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mCreated new worktree for [1m[32mexec-test[0m[0m- [2mPath: [REPO]/../test-repo.exec-test[0m-+✅ [32mCreated new worktree for [1mexec-test[0m+ [2mPath: [REPO]/../test-repo.exec-test[0m[0mtest output----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__switch__switch_existing_branch.snap b/tests/snapshots/integration__integration_tests__switch__switch_existing_branch.snapindex 2fa510ac1..51dcc187c 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_existing_branch.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_existing_branch.snap@@ -19,7 +19,7 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mSwitched to worktree for [1m[32mfeature-z[0m[0m+✅ [32mSwitched to worktree for [1mfeature-z[0m[0mTo enable automatic cd, run: wt configure-shelldiff --git a/tests/snapshots/integration__integration_tests__switch__switch_existing_internal.snap b/tests/snapshots/integration__integration_tests__switch__switch_existing_internal.snapindex c18b6f2e8..dab60f80b 100644Binary files a/tests/snapshots/integration__integration_tests__switch__switch_existing_internal.snap and b/tests/snapshots/integration__integration_tests__switch__switch_existing_internal.snap differdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_internal_mode.snap b/tests/snapshots/integration__integration_tests__switch__switch_internal_mode.snapindex 0f0265750..916a0fec7 100644Binary files a/tests/snapshots/integration__integration_tests__switch__switch_internal_mode.snap and b/tests/snapshots/integration__integration_tests__switch__switch_internal_mode.snap differdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_internal_with_execute.snap b/tests/snapshots/integration__integration_tests__switch__switch_internal_with_execute.snapindex 6fff1ab96..247803cd3 100644Binary files a/tests/snapshots/integration__integration_tests__switch__switch_internal_with_execute.snap and b/tests/snapshots/integration__integration_tests__switch__switch_internal_with_execute.snap differdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_execute_still_runs.snap b/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_execute_still_runs.snapindex c43b23987..07e79da3b 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_execute_still_runs.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_execute_still_runs.snap@@ -23,9 +23,8 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mCreated new worktree for [1m[32mno-config-commands-test[0m[0m- [2mPath: [REPO]/../test-repo.no-config-commands-test[0m-+✅ [32mCreated new worktree for [1mno-config-commands-test[0m+ [2mPath: [REPO]/../test-repo.no-config-commands-test[0m[0mexecute command runs----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_existing.snap b/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_existing.snapindex 2433d9f82..3f1bb34fe 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_existing.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_existing.snap@@ -22,8 +22,7 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mSwitched to worktree for [1m[32mexisting-no-config-commands[0m[0m-+✅ [32mSwitched to worktree for [1mexisting-no-config-commands[0m[0mexecute still runs----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_skips_post_start.snap b/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_skips_post_start.snapindex 110238d4b..42b2e1858 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_skips_post_start.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_skips_post_start.snap@@ -14,7 +14,7 @@ info:GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/nullGIT_EDITOR: ""- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpqatjYg+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpNFSOzvLANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1704067200"@@ -22,8 +22,8 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mCreated new worktree for [1m[32mno-post-start[0m[0m- [2mPath: [REPO]/../test-repo.no-post-start[0m+✅ [32mCreated new worktree for [1mno-post-start[0m+ [2mPath: [REPO]/../test-repo.no-post-start[0m[0mTo enable automatic cd, run: wt configure-shelldiff --git a/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_with_force.snap b/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_with_force.snapindex 5e9410378..c789364ce 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_with_force.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_no_config_commands_with_force.snap@@ -15,7 +15,7 @@ info:GIT_CONFIG_GLOBAL: /dev/nullGIT_CONFIG_SYSTEM: /dev/nullGIT_EDITOR: ""- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpD3ng3v+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpAByZ8MLANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1704067200"@@ -23,8 +23,8 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mCreated new worktree for [1m[32mforce-no-config-commands[0m[0m- [2mPath: [REPO]/../test-repo.force-no-config-commands[0m+✅ [32mCreated new worktree for [1mforce-no-config-commands[0m+ [2mPath: [REPO]/../test-repo.force-no-config-commands[0m[0mTo enable automatic cd, run: wt configure-shelldiff --git a/tests/snapshots/integration__integration_tests__switch__switch_with_base.snap b/tests/snapshots/integration__integration_tests__switch__switch_with_base.snapindex d46e5d63e..bd17825c0 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_with_base.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_with_base.snap@@ -22,8 +22,8 @@ info:success: trueexit_code: 0----- stdout ------✅ [32mCreated new worktree for [1m[32mfeature-with-base[0m[0m- [2mPath: [REPO]/../test-repo.feature-with-base[0m+✅ [32mCreated new worktree for [1mfeature-with-base[0m+ [2mPath: [REPO]/../test-repo.feature-with-base[0m[0mTo enable automatic cd, run: wt configure-shell