Skip to content

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

Refactor: Move output handling to dedicated module

Maximilian Roos84c5bf5e6f75
diff --git a/src/commands/merge.rs b/src/commands/merge.rs
index 8cd909612..bd0065dd6 100644
--- a/src/commands/merge.rs
+++ b/src/commands/merge.rs
@@ -5,6 +5,7 @@ use worktrunk::styling::{AnstyleStyle, ERROR, ERROR_EMOJI, HINT, HINT_EMOJI, epr
use super::worktree::handle_push;
use super::worktree::handle_remove;
+use crate::output::handle_remove_output;
pub fn handle_merge(
target: Option<&str>,
@@ -69,13 +70,7 @@ pub fn handle_merge(
let result = handle_remove()?;
// Display output based on mode
- if internal {
- if let Some(output) = result.format_internal_output() {
- println!("{}", output);
- }
- } else if let Some(output) = result.format_user_output() {
- println!("{}", output);
- }
+ handle_remove_output(&result, internal)?;
// Check if we need to switch to target branch
let primary_repo = Repository::at(&primary_worktree_dir);
diff --git a/src/commands/mod.rs b/src/commands/mod.rs
index 6c92d1593..a7c0623af 100644
--- a/src/commands/mod.rs
+++ b/src/commands/mod.rs
@@ -10,9 +10,7 @@ pub use configure_shell::{ConfigAction, handle_configure_shell};
pub use init::handle_init;
pub use list::handle_list;
pub use merge::handle_merge;
-pub use worktree::{
- execute_command_in_worktree, handle_push, handle_remove, handle_switch, shell_integration_hint,
-};
+pub use worktree::{handle_push, handle_remove, handle_switch};
// Re-export Shell from the canonical location
pub use worktrunk::shell::Shell;
diff --git a/src/commands/worktree.rs b/src/commands/worktree.rs
index d095322f2..4d99e4639 100644
--- a/src/commands/worktree.rs
+++ b/src/commands/worktree.rs
@@ -57,10 +57,14 @@
//!
//! # Implementation Details
//!
-//! Result types (`SwitchResult`, `RemoveResult`) provide two formatting methods:
+//! Result types (`SwitchResult`, `RemoveResult`) are pure data structures that only contain
+//! operation results. All presentation logic is handled by the `output` module:
//!
-//! - `format_user_output()`: Returns human-friendly messages (no directives)
-//! - `format_internal_output()`: Returns directive protocol + messages
+//! - `output::handle_switch_output()`: Formats and outputs switch operation results
+//! - `output::handle_remove_output()`: Formats and outputs remove operation results
+//!
+//! These handlers automatically select the appropriate mode (user-friendly or directive protocol)
+//! based on the `internal` flag
//!
//! ## Directive Protocol
//!
@@ -101,26 +105,11 @@ use std::io::{self, Write};
use std::path::PathBuf;
use worktrunk::config::{ProjectConfig, WorktrunkConfig, expand_template};
use worktrunk::git::{GitError, Repository};
-use worktrunk::shell::Shell;
use worktrunk::styling::{
AnstyleStyle, ERROR, ERROR_EMOJI, HINT, HINT_EMOJI, WARNING, WARNING_EMOJI, eprintln, println,
};
-/// Generate hint message for shell integration setup
-///
-/// Returns a hint message based on whether shell integration is configured:
-/// - If configured but not active: provides exact source command
-/// - If not configured: suggests running configure-shell
-pub fn shell_integration_hint() -> String {
- if let Some(config_path) = Shell::is_integration_configured() {
- format!(
- "\n\nShell integration configured. Restart your shell or run: source {}",
- config_path.display()
- )
- } else {
- "\n\nTo enable automatic cd, run: wt configure-shell".to_string()
- }
-}
+use crate::output::execute_command_in_worktree;
/// Result of a worktree switch operation
pub enum SwitchResult {
@@ -138,38 +127,6 @@ impl SwitchResult {
SwitchResult::CreatedWorktree { path, .. } => path,
}
}
-
- /// Format a user-friendly message for this result
- pub fn format_message(&self, branch: &str) -> String {
- use anstyle::{AnsiColor, Color};
- let green = AnstyleStyle::new().fg_color(Some(Color::Ansi(AnsiColor::Green)));
- let green_bold = green.bold();
-
- match self {
- 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()
- )
- }
- }
- }
- }
}
/// Result of a worktree remove operation
@@ -182,60 +139,6 @@ pub enum RemoveResult {
SwitchedToDefault(String),
}
-impl RemoveResult {
- /// Format the result for display (non-internal mode)
- pub fn format_user_output(&self) -> Option<String> {
- use anstyle::{AnsiColor, Color};
-
- match self {
- RemoveResult::AlreadyOnDefault(branch) => {
- let green = AnstyleStyle::new().fg_color(Some(Color::Ansi(AnsiColor::Green)));
- let green_bold = green.bold();
- Some(format!(
- "✅ {green}Already on default branch {green_bold}{branch}{green_bold:#}{green:#}"
- ))
- }
- RemoveResult::RemovedWorktree { primary_path } => {
- let green = AnstyleStyle::new().fg_color(Some(Color::Ansi(AnsiColor::Green)));
- let dim = AnstyleStyle::new().dimmed();
- Some(format!(
- "✅ {green}Removed worktree and returned to primary{green:#}\n {dim}Path: {}{dim:#}\n\nTo enable automatic cd, run: wt configure-shell",
- primary_path.display()
- ))
- }
- RemoveResult::SwitchedToDefault(branch) => {
- let green = AnstyleStyle::new().fg_color(Some(Color::Ansi(AnsiColor::Green)));
- let green_bold = green.bold();
- Some(format!(
- "✅ {green}Switched to default branch {green_bold}{branch}{green_bold:#}{green:#}"
- ))
- }
- }
- }
-
- /// Format the result for shell integration (internal mode)
- ///
- /// Directives are NUL-terminated for consistency with switch command.
- pub fn format_internal_output(&self) -> Option<String> {
- use anstyle::{AnsiColor, Color};
-
- match self {
- RemoveResult::AlreadyOnDefault(_) => None,
- RemoveResult::RemovedWorktree { primary_path } => {
- let green = AnstyleStyle::new().fg_color(Some(Color::Ansi(AnsiColor::Green)));
- let mut result = format!("__WORKTRUNK_CD__{}", primary_path.display());
- result.push('\0');
- result.push_str(&format!(
- "✅ {green}Removed worktree and returned to primary{green:#}"
- ));
- result.push('\0');
- Some(result)
- }
- RemoveResult::SwitchedToDefault(_) => None,
- }
- }
-}
-
pub fn handle_switch(
branch: &str,
create: bool,
@@ -323,49 +226,6 @@ pub fn handle_switch(
})
}
-/// Execute a command in the specified worktree directory
-///
-/// # Security
-///
-/// This function executes arbitrary shell commands provided by the user via the -x flag.
-/// The command is passed directly to sh -c (or cmd /C on Windows) without sanitization.
-/// This is intentional - the user is executing their own commands in their own environment.
-///
-/// # Trust Model
-///
-/// - Commands originate from the user's CLI invocation (`wt switch -x "command"`)
-/// - Commands may contain newlines
-/// - The threat model assumes the user trusts their own command input
-pub fn execute_command_in_worktree(
- worktree_path: &std::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(())
-}
-
pub fn handle_remove() -> Result<RemoveResult, GitError> {
let repo = Repository::current();
diff --git a/src/main.rs b/src/main.rs
index 5631dca8a..4be816c61 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,6 +1,5 @@
use anstyle::Style;
use clap::{CommandFactory, Parser, Subcommand};
-use std::io::Write;
use std::process;
use worktrunk::config::WorktrunkConfig;
use worktrunk::git::GitError;
@@ -9,12 +8,13 @@ use worktrunk::styling::println;
mod commands;
mod display;
mod llm;
+mod output;
use commands::{
- ConfigAction, Shell, execute_command_in_worktree, handle_complete, handle_completion,
- handle_configure_shell, handle_init, handle_list, handle_merge, handle_push, handle_remove,
- handle_switch, shell_integration_hint,
+ ConfigAction, Shell, handle_complete, handle_completion, handle_configure_shell, handle_init,
+ handle_list, handle_merge, handle_push, handle_remove, handle_switch,
};
+use output::{handle_remove_output, handle_switch_output};
#[derive(Debug, Clone, Copy, clap::ValueEnum)]
pub enum OutputFormat {
@@ -219,52 +219,12 @@ fn main() {
.map_err(|e| GitError::CommandFailed(format!("Failed to load config: {}", e)))
.and_then(|config| {
handle_switch(&branch, create, base.as_deref(), force, &config).and_then(|result| {
- if internal {
- // Internal mode: output directives for shell wrapper
- use std::io::Write;
- let mut stdout = std::io::stdout();
-
- // Write CD directive
- let _ = write!(stdout, "__WORKTRUNK_CD__{}\0", result.path().display());
-
- // Write message
- let _ = write!(stdout, "{}\0", result.format_message(&branch));
-
- // If execute flag present, write EXEC directive
- if let Some(cmd) = execute.as_deref() {
- let _ = write!(stdout, "__WORKTRUNK_EXEC__{}\0", cmd);
- }
-
- // Final newline for readability in logs
- let _ = stdout.write_all(b"\n");
- Ok(())
- } else {
- // Non-internal mode: print message and execute command
- println!("{}", result.format_message(&branch));
-
- if let Some(cmd) = execute.as_deref() {
- // Execute command after showing message
- println!();
- execute_command_in_worktree(result.path(), cmd)?;
- } else {
- // Show shell integration hint if no command to execute
- println!("{}", shell_integration_hint());
- }
- Ok(())
- }
+ handle_switch_output(&result, &branch, execute.as_deref(), internal)
})
}),
- Commands::Remove { internal } => handle_remove().map(|result| {
- if internal {
- if let Some(output) = result.format_internal_output() {
- // Use write! to preserve NUL bytes
- let _ = std::io::stdout().write_all(output.as_bytes());
- let _ = std::io::stdout().write_all(b"\n");
- }
- } else if let Some(output) = result.format_user_output() {
- println!("{}", output);
- }
- }),
+ Commands::Remove { internal } => {
+ handle_remove().and_then(|result| handle_remove_output(&result, internal))
+ }
Commands::Push {
target,
allow_merge_commits,
diff --git a/src/output.rs b/src/output.rs
new file mode 100644
index 000000000..b63db5cef
--- /dev/null
+++ b/src/output.rs
@@ -0,0 +1,242 @@
+//! 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/tests/snapshots/integration__integration_tests__post_start_commands__post_start_empty_array.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_empty_array.snap
index f7f86c151..8c438a5fb 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_empty_array.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_empty_array.snap
@@ -23,7 +23,6 @@ exit_code: 0
✅ Created new worktree for feature
Path: [REPO].feature
-
To enable automatic cd, run: wt configure-shell
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_failing_command.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_failing_command.snap
index 6e5fd1290..dd5a97417 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_failing_command.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_failing_command.snap
@@ -13,7 +13,7 @@ info:
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpQrrlBo
+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpQmUBXp
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1704067200"
@@ -24,7 +24,6 @@ exit_code: 0
✅ Created new worktree for feature
Path: [REPO].feature
-
To enable automatic cd, run: wt configure-shell
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_invalid_toml.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_invalid_toml.snap
index 6d96b1fe3..64c63a665 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_invalid_toml.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_invalid_toml.snap
@@ -23,7 +23,6 @@ exit_code: 0
✅ Created new worktree for feature
Path: [REPO].feature
-
To enable automatic cd, run: wt configure-shell
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiple_commands.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiple_commands.snap
index c64ca729e..69e12c973 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiple_commands.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiple_commands.snap
@@ -13,7 +13,7 @@ info:
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp5RmQcF
+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp7JwUkM
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1704067200"
@@ -26,7 +26,6 @@ Second
✅ Created new worktree for feature
Path: [REPO].feature
-
To enable automatic cd, run: wt configure-shell
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_no_config.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_no_config.snap
index f7f86c151..8c438a5fb 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_no_config.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_no_config.snap
@@ -23,7 +23,6 @@ exit_code: 0
✅ Created new worktree for feature
Path: [REPO].feature
-
To enable automatic cd, run: wt configure-shell
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_template_expansion.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_template_expansion.snap
index b7f0c7947..baecf9bab 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_template_expansion.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_template_expansion.snap
@@ -13,7 +13,7 @@ info:
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpiJeZmq
+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpxHBIw9
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1704067200"
@@ -24,7 +24,6 @@ exit_code: 0
✅ Created new worktree for feature/test
Path: [REPO].feature-test
-
To enable automatic cd, run: wt configure-shell
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_with_approval.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_with_approval.snap
index af794d2a8..021b64365 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_with_approval.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_with_approval.snap
@@ -13,7 +13,7 @@ info:
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
- HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp0AL9rq
+ HOME: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpF0Nd0x
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1704067200"
@@ -25,7 +25,6 @@ Setup complete
✅ Created new worktree for feature
Path: [REPO].feature
-
To enable automatic cd, run: wt configure-shell
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__remove__remove_internal_mode.snap b/tests/snapshots/integration__integration_tests__remove__remove_internal_mode.snap
index c8aacb5a9..3d43ecf74 100644
Binary files a/tests/snapshots/integration__integration_tests__remove__remove_internal_mode.snap and b/tests/snapshots/integration__integration_tests__remove__remove_internal_mode.snap differ
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.snap
index 550d3c88e..2f7565116 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
@@ -23,7 +23,6 @@ exit_code: 0
----- stdout -----
✅ Switched to worktree for main
-
To enable automatic cd, run: wt configure-shell
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_create_new.snap b/tests/snapshots/integration__integration_tests__switch__switch_create_new.snap
index c29020bed..bcc9a2884 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_create_new.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_create_new.snap
@@ -23,7 +23,6 @@ exit_code: 0
✅ Created new worktree for feature-x
Path: [REPO].feature-x
-
To enable automatic cd, run: wt configure-shell
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_existing_branch.snap b/tests/snapshots/integration__integration_tests__switch__switch_existing_branch.snap
index e1fd2feeb..2fa510ac1 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_existing_branch.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_existing_branch.snap
@@ -21,7 +21,6 @@ exit_code: 0
----- stdout -----
✅ Switched to worktree for feature-z
-
To enable automatic cd, run: wt configure-shell
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_with_base.snap b/tests/snapshots/integration__integration_tests__switch__switch_with_base.snap
index 4912b99e6..735428af2 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_with_base.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_with_base.snap
@@ -25,7 +25,6 @@ exit_code: 0
✅ Created new worktree for feature-with-base
Path: [REPO].feature-with-base
-
To enable automatic cd, run: wt configure-shell
----- stderr -----