Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
Validate before approval in switch and remove commands (#582)
Maximilian Roosdd61e77fb3f7
diff --git a/src/commands/mod.rs b/src/commands/mod.rsindex d35f86e74..a20ae7074 100644--- a/src/commands/mod.rs+++ b/src/commands/mod.rs@@ -42,8 +42,8 @@ pub(crate) use step_commands::{step_show_squash_prompt,};pub(crate) use worktree::{- ResolutionContext, compute_worktree_path, handle_remove, handle_remove_current, handle_switch,- is_worktree_at_expected_path, resolve_worktree_arg, worktree_display_name,+ ResolutionContext, execute_switch, handle_remove, handle_remove_current,+ is_worktree_at_expected_path, plan_switch, resolve_worktree_arg, worktree_display_name,};// Re-export Shell from the canonical locationdiff --git a/src/commands/select.rs b/src/commands/select.rsindex 545453744..437534fad 100644--- a/src/commands/select.rs+++ b/src/commands/select.rs@@ -16,7 +16,7 @@ use worktrunk::shell_exec::Cmd;use super::list::collect;use super::list::layout::{DiffDisplayConfig, DiffVariant};use super::list::model::ListItem;-use super::worktree::handle_switch;+use super::worktree::{execute_switch, plan_switch};use crate::output::handle_switch_output;use crate::pager::{git_config_pager, parse_pager_value};@@ -1178,11 +1178,11 @@ pub fn handle_select(// Load configlet config = WorktrunkConfig::load().context("Failed to load config")?;+ let repo = Repository::current().context("Failed to switch worktree")?;- // Switch to the selected worktree- // handle_switch can handle both branch names and worktree paths- let (result, branch_info) =- handle_switch(&identifier, false, None, false, false, false, &config)?;+ // Switch to the selected worktree (no creation, no approval prompts)+ let plan = plan_switch(&repo, &identifier, false, None, false, &config)?;+ let (result, branch_info) = execute_switch(&repo, plan, &config, false, true)?;// Clear the terminal screen after skim exits to prevent artifacts// Use stderr for terminal control - stdout is reserved for data outputdiff --git a/src/commands/worktree.rs b/src/commands/worktree.rsindex 4c6b80834..d0029e429 100644--- a/src/commands/worktree.rs+++ b/src/commands/worktree.rs@@ -82,7 +82,7 @@ use anyhow::Context;use color_print::cformat;use dunce::canonicalize;use normalize_path::NormalizePath;-use std::path::PathBuf;+use std::path::{Path, PathBuf};use worktrunk::HookType;use worktrunk::config::WorktrunkConfig;use worktrunk::git::{GitError, Repository, ResolvedWorktree};@@ -99,21 +99,24 @@ use super::repository_ext::{RemoveTarget, RepositoryCliExt};////// For paths with extensions: `file.txt` → `file.txt.bak.TIMESTAMP`/// For paths without extensions: `foo` → `foo.bak.TIMESTAMP`-fn generate_backup_path(path: &std::path::Path, suffix: &str) -> PathBuf {+///+/// Returns an error for unusual paths without a file name (e.g., `/` or `..`).+fn generate_backup_path(path: &std::path::Path, suffix: &str) -> anyhow::Result<PathBuf> {+ let file_name = path+ .file_name()+ .ok_or_else(|| anyhow::anyhow!("Cannot generate backup path for {}", path.display()))?;+if path.extension().is_none() {// Path has no extension (e.g., /repo/feature)- path.with_file_name(format!(- "{}.bak.{suffix}",- path.file_name().unwrap().to_string_lossy()- ))+ Ok(path.with_file_name(format!("{}.bak.{suffix}", file_name.to_string_lossy())))} else {// Path has an extension (e.g., /repo.feature or /file.txt)- path.with_extension(format!(+ Ok(path.with_extension(format!("{}.bak.{suffix}",path.extension().map(|e| e.to_string_lossy().to_string()).unwrap_or_default()- ))+ )))}}@@ -345,6 +348,60 @@ pub struct SwitchBranchInfo {pub expected_path: Option<PathBuf>,}+/// Validated plan for a switch operation.+///+/// Created by `plan_switch()`, consumed by `execute_switch()`.+/// This separation allows validation to happen before approval prompts,+/// ensuring users aren't asked to approve hooks for operations that will fail.+#[derive(Debug)]+pub enum SwitchPlan {+ /// Branch already has a worktree - just switch to it (no git commands needed)+ Existing {+ path: PathBuf,+ branch: String,+ /// Expected path for mismatch detection+ expected_path: PathBuf,+ /// Branch to record as "previous" for `wt switch -`+ new_previous: Option<String>,+ },+ /// Need to create a new worktree+ Create {+ branch: String,+ worktree_path: PathBuf,+ /// True if using `-b` to create a new branch (--create flag)+ create_branch: bool,+ /// Base branch for creation (resolved, validated to exist)+ base_branch: Option<String>,+ /// If path exists and --clobber, this is the backup path to move it to+ clobber_backup: Option<PathBuf>,+ /// Branch to record as "previous" for `wt switch -`+ new_previous: Option<String>,+ },+}++impl SwitchPlan {+ /// Get the worktree path for this plan.+ pub fn worktree_path(&self) -> &Path {+ match self {+ SwitchPlan::Existing { path, .. } => path,+ SwitchPlan::Create { worktree_path, .. } => worktree_path,+ }+ }++ /// Get the branch name for this plan.+ pub fn branch(&self) -> &str {+ match self {+ SwitchPlan::Existing { branch, .. } => branch,+ SwitchPlan::Create { branch, .. } => branch,+ }+ }++ /// Returns true if this plan will create a new worktree.+ pub fn is_create(&self) -> bool {+ matches!(self, SwitchPlan::Create { .. })+ }+}+/// How the branch should be handled after worktree removal.////// This enum replaces the previous `no_delete_branch: bool, force_delete: bool` pattern,@@ -413,29 +470,31 @@ pub enum RemoveResult {},}-pub fn handle_switch(+/// Validate and plan a switch operation.+///+/// This performs all validation upfront, returning a `SwitchPlan` that can be+/// executed later. Call this BEFORE approval prompts to ensure users aren't+/// asked to approve hooks for operations that will fail.+///+/// Warnings (remote branch shadow, --base without --create, invalid default branch)+/// are printed during planning since they're informational, not blocking.+pub fn plan_switch(+ repo: &Repository,branch: &str,create: bool,base: Option<&str>,- force: bool,clobber: bool,- no_verify: bool,config: &WorktrunkConfig,-) -> anyhow::Result<(SwitchResult, SwitchBranchInfo)> {- let repo = Repository::current()?;-+) -> anyhow::Result<SwitchPlan> {// Get the actual current branch BEFORE switching.// This is what we'll record as "previous" in history for `wt switch -` support.- let actual_current_branch = repo.current_worktree().branch().ok().flatten();+ let new_previous = repo.current_worktree().branch().ok().flatten();// Resolve special branch names ("@" for current, "-" for previous)let resolved_branch = repo.resolve_worktree_name(branch).context("Failed to resolve branch name")?;- // Record actual current branch as new "previous" for ping-pong behavior- let new_previous = actual_current_branch;-// Resolve base if providedlet resolved_base = if let Some(base_str) = base {Some(repo.resolve_worktree_name(base_str)?)@@ -475,43 +534,17 @@ pub fn handle_switch(}// Compute expected worktree path for this branch- let expected_path = compute_worktree_path(&repo, &resolved_branch, config)?;-- // Helper to build switch result for an existing worktree.- let switch_to_existing = |path: PathBuf| -> (SwitchResult, SwitchBranchInfo) {- let canonical_path = canonicalize(&path).unwrap_or(path.clone());- let current_dir = std::env::current_dir()- .ok()- .and_then(|p| canonicalize(&p).ok());- let already_at_worktree = current_dir- .as_ref()- .map(|cur| cur == &canonical_path)- .unwrap_or(false);-- // Check if the actual path matches the expected path (branch-worktree mismatch detection).- let mismatch_path = if !paths_match(&path, &expected_path) {- Some(expected_path.clone())- } else {- None- };-- let result = if already_at_worktree {- SwitchResult::AlreadyAt(canonical_path)- } else {- SwitchResult::Existing(canonical_path)- };- let branch_info = SwitchBranchInfo {- branch: resolved_branch.clone(),- expected_path: mismatch_path,- };- (result, branch_info)- };+ let expected_path = compute_worktree_path(repo, &resolved_branch, config)?;// Branch-first lookup: check if branch has a worktree anywherematch repo.worktree_for_branch(&resolved_branch)? {Some(existing_path) if existing_path.exists() => {- let _ = repo.record_switch_previous(new_previous.as_deref());- return Ok(switch_to_existing(existing_path));+ return Ok(SwitchPlan::Existing {+ path: canonicalize(&existing_path).unwrap_or(existing_path),+ branch: resolved_branch,+ expected_path,+ new_previous,+ });}Some(_) => {return Err(GitError::WorktreeMissing {@@ -523,10 +556,6 @@ pub fn handle_switch(}// No worktree for branch - validate branch exists before proceeding- // When not creating, the branch must exist (locally or on remote)- // Note: This check could be moved to the error recovery path (after git worktree add- // fails) to avoid the ~10ms overhead on the happy path. We'd detect "invalid reference"- // in the error, then call branch_exists() to determine which branch is invalid.if !create && !repo.branch_exists(&resolved_branch)? {return Err(GitError::InvalidReference {reference: resolved_branch.clone(),@@ -534,15 +563,12 @@ pub fn handle_switch(.into());}- // No worktree for branch - check if expected path is occupied by a different branch's worktree+ // Check if expected path is occupied by a different branch's worktreeif let Some((existing_path, path_branch)) = repo.worktree_at_path(&expected_path)? {if !existing_path.exists() {- // Stale worktree metadata - git thinks there's a worktree but directory is gonelet branch = path_branch.unwrap_or_else(|| resolved_branch.clone());return Err(GitError::WorktreeMissing { branch }.into());}-- // Path is occupied by a different branch's worktreereturn Err(GitError::WorktreePathOccupied {branch: resolved_branch.clone(),path: expected_path,@@ -551,55 +577,35 @@ pub fn handle_switch(.into());}- // No existing worktree for branch or at expected path - will create one- let worktree_path = expected_path;-- // If the target path already exists but is NOT a worktree (e.g., stale directory),- // either move it to .bak (with --clobber) or surface a helpful error.- if worktree_path.exists() {+ // Determine clobber backup path if needed+ let clobber_backup = if expected_path.exists() {if clobber {- use anyhow::Context;-- // Generate timestamped backup pathlet timestamp = worktrunk::utils::get_now() as i64;let datetime =chrono::DateTime::from_timestamp(timestamp, 0).unwrap_or_else(chrono::Utc::now);let suffix = datetime.format("%Y%m%d-%H%M%S").to_string();- let backup_path = generate_backup_path(&worktree_path, &suffix);+ let backup_path = generate_backup_path(&expected_path, &suffix)?;- // Error if backup path already existsif backup_path.exists() {anyhow::bail!("Backup path already exists: {}",worktrunk::path::format_path_for_display(&backup_path));}-- let path_display = worktrunk::path::format_path_for_display(&worktree_path);- let backup_display = worktrunk::path::format_path_for_display(&backup_path);- crate::output::print(warning_message(cformat!(- "Moving <bold>{path_display}</> to <bold>{backup_display}</> (--clobber)"- )))?;-- std::fs::rename(&worktree_path, &backup_path)- .with_context(|| format!("Failed to move {path_display} to {backup_display}"))?;+ Some(backup_path)} else {return Err(GitError::WorktreePathExists {branch: resolved_branch.clone(),- path: worktree_path,+ path: expected_path,create,}.into());}- }-- // Create the worktree- // Build git worktree add command- let worktree_path_str = worktree_path.to_string_lossy();- let mut args = vec!["worktree", "add", worktree_path_str.as_ref()];+ } else {+ None+ };- // Check for invalid configured default branch when creating without explicit --base.- // Show warning if user's configured default branch doesn't exist locally.+ // Check for invalid configured default branch when creating without explicit --baseif create&& resolved_base.is_none()&& let Some(configured) = repo.invalid_default_branch_config()@@ -612,13 +618,10 @@ pub fn handle_switch()))?;}- // Use the resolved base, or default to default branch if creating without a base.- // For bare repos with no branches yet (bootstrap case), allow None to create orphan branch.- let base_for_creation = if create {+ // Resolve base branch for creation+ let base_branch = if create {match resolved_base {Some(ref b) => {- // Validate that the explicitly specified base branch exists- // (Same note as above re: moving to error recovery path for performance)if !repo.branch_exists(b)? {return Err(GitError::InvalidReference {reference: b.clone(),@@ -627,124 +630,176 @@ pub fn handle_switch(}Some(b.clone())}- None => {- // Try to use default branch as base, but only if it actually exists- // (has commits). For empty repos, the default branch is unborn and- // git will automatically create an orphan worktree.- repo.resolve_target_branch(None)- .ok()- .filter(|b| repo.local_branch_exists(b).unwrap_or(false))- }+ None => repo+ .resolve_target_branch(None)+ .ok()+ .filter(|b| repo.local_branch_exists(b).unwrap_or(false)),}} else {None};- // Build args based on whether we're creating or checking out- if create {- args.push("-b");- args.push(&resolved_branch);- if let Some(ref base_branch) = base_for_creation {- args.push(base_branch);+ Ok(SwitchPlan::Create {+ branch: resolved_branch,+ worktree_path: expected_path,+ create_branch: create,+ base_branch,+ clobber_backup,+ new_previous,+ })+}++/// Execute a validated switch plan.+///+/// Takes a `SwitchPlan` from `plan_switch()` and executes it.+/// For `SwitchPlan::Existing`, just records history.+/// For `SwitchPlan::Create`, creates the worktree and runs hooks.+pub fn execute_switch(+ repo: &Repository,+ plan: SwitchPlan,+ config: &WorktrunkConfig,+ force: bool,+ no_verify: bool,+) -> anyhow::Result<(SwitchResult, SwitchBranchInfo)> {+ match plan {+ SwitchPlan::Existing {+ path,+ branch,+ expected_path,+ new_previous,+ } => {+ let _ = repo.record_switch_previous(new_previous.as_deref());++ let current_dir = std::env::current_dir()+ .ok()+ .and_then(|p| canonicalize(&p).ok());+ let already_at_worktree = current_dir+ .as_ref()+ .map(|cur| cur == &path)+ .unwrap_or(false);++ let mismatch_path = if !paths_match(&path, &expected_path) {+ Some(expected_path)+ } else {+ None+ };++ let result = if already_at_worktree {+ SwitchResult::AlreadyAt(path)+ } else {+ SwitchResult::Existing(path)+ };++ Ok((+ result,+ SwitchBranchInfo {+ branch,+ expected_path: mismatch_path,+ },+ ))}- } else {- args.push(&resolved_branch);- }- // Create worktree and parse specific error cases- if let Err(e) = repo.run_command(&args) {- let msg = e.to_string();- // Check if error is about directory already existing- if msg.contains("already exists") {- // Parse the path from git's error message- // Format: "fatal: '/path/to/dir' already exists"- if let Some(path_str) = msg- .lines()- .find(|line| line.contains("already exists"))- .and_then(|line| {- // Extract path between quotes- line.split('\'').nth(1).or_else(|| line.split('"').nth(1))- })- {- return Err(GitError::WorktreePathExists {- branch: resolved_branch.clone(),- path: std::path::PathBuf::from(path_str),- create,+ SwitchPlan::Create {+ branch,+ worktree_path,+ create_branch,+ base_branch,+ clobber_backup,+ new_previous,+ } => {+ // Handle --clobber backup if needed+ if let Some(backup_path) = clobber_backup {+ let path_display = worktrunk::path::format_path_for_display(&worktree_path);+ let backup_display = worktrunk::path::format_path_for_display(&backup_path);+ crate::output::print(warning_message(cformat!(+ "Moving <bold>{path_display}</> to <bold>{backup_display}</> (--clobber)"+ )))?;++ std::fs::rename(&worktree_path, &backup_path).with_context(|| {+ format!("Failed to move {path_display} to {backup_display}")+ })?;+ }++ // Build git worktree add command+ let worktree_path_str = worktree_path.to_string_lossy();+ let mut args = vec!["worktree", "add", worktree_path_str.as_ref()];++ if create_branch {+ args.push("-b");+ args.push(&branch);+ if let Some(ref base) = base_branch {+ args.push(base);}- .into());+ } else {+ args.push(&branch);}- }- // Fall back to generic error with context- // Note: "invalid reference" errors are caught by upfront validation (lines 529, 621)- return Err(GitError::WorktreeCreationFailed {- branch: resolved_branch.clone(),- base_branch: base_for_creation.clone(),- error: msg,- }- .into());- }- // Check if git's DWIM created a tracking branch from a remote- // This happens when we don't use --create and the branch exists on a remote- let from_remote = if !create {- // Query the new worktree for its upstream tracking branch- repo.upstream_branch(&resolved_branch)?- } else {- None- };+ // Create worktree+ if let Err(e) = repo.run_command(&args) {+ return Err(GitError::WorktreeCreationFailed {+ branch: branch.clone(),+ base_branch: base_branch.clone(),+ error: e.to_string(),+ }+ .into());+ }- // Compute base worktree path once for hooks and result- let base_worktree_path = base_for_creation- .as_ref()- .and_then(|b| repo.worktree_for_branch(b).ok().flatten())- .map(|p| worktrunk::path::to_posix_path(&p.to_string_lossy()));-- // Execute post-create commands (sequential, blocking)- // Note: If user declines, continue anyway - worktree already created- if !no_verify {- let repo_root = repo.worktree_base()?;- let ctx = CommandContext::new(- &repo,- config,- Some(&resolved_branch),- &worktree_path,- &repo_root,- force,- );+ // Check if git's DWIM created a tracking branch from a remote+ let from_remote = if !create_branch {+ repo.upstream_branch(&branch)?+ } else {+ None+ };- let extra_vars: Vec<(&str, &str)> = [- base_for_creation.as_ref().map(|b| ("base", b.as_str())),- base_worktree_path+ // Compute base worktree path for hooks and result+ let base_worktree_path = base_branch.as_ref()- .map(|p| ("base_worktree_path", p.as_str())),- ]- .into_iter()- .flatten()- .collect();-- // Approval was handled at the gate- ctx.execute_post_create_commands(&extra_vars)?;- }+ .and_then(|b| repo.worktree_for_branch(b).ok().flatten())+ .map(|p| worktrunk::path::to_posix_path(&p.to_string_lossy()));++ // Execute post-create commands+ if !no_verify {+ let repo_root = repo.worktree_base()?;+ let ctx = CommandContext::new(+ repo,+ config,+ Some(&branch),+ &worktree_path,+ &repo_root,+ force,+ );- // Note: post-start commands are spawned AFTER success message is shown- // (see main.rs switch handler for temporal locality)-- // Record successful switch in history for `wt switch -` support- let _ = repo.record_switch_previous(new_previous.as_deref());-- Ok((- SwitchResult::Created {- path: worktree_path,- created_branch: create,- base_branch: base_for_creation,- base_worktree_path,- from_remote,- },- SwitchBranchInfo {- branch: resolved_branch,- expected_path: None, // Created at expected path by definition- },- ))+ let extra_vars: Vec<(&str, &str)> = [+ base_branch.as_ref().map(|b| ("base", b.as_str())),+ base_worktree_path+ .as_ref()+ .map(|p| ("base_worktree_path", p.as_str())),+ ]+ .into_iter()+ .flatten()+ .collect();++ ctx.execute_post_create_commands(&extra_vars)?;+ }++ // Record successful switch in history+ let _ = repo.record_switch_previous(new_previous.as_deref());++ Ok((+ SwitchResult::Created {+ path: worktree_path,+ created_branch: create_branch,+ base_branch,+ base_worktree_path,+ from_remote,+ },+ SwitchBranchInfo {+ branch,+ expected_path: None,+ },+ ))+ }+ }}pub fn handle_remove(@@ -1245,14 +1300,14 @@ mod tests {fn test_generate_backup_path_with_extension() {// Paths with extensions: file.txt -> file.txt.bak.TIMESTAMPlet path = PathBuf::from("/tmp/repo.feature");- let backup = super::generate_backup_path(&path, "20250101-000000");+ let backup = super::generate_backup_path(&path, "20250101-000000").unwrap();assert_eq!(backup,PathBuf::from("/tmp/repo.feature.bak.20250101-000000"));let path = PathBuf::from("/tmp/file.txt");- let backup = super::generate_backup_path(&path, "20250101-000000");+ let backup = super::generate_backup_path(&path, "20250101-000000").unwrap();assert_eq!(backup, PathBuf::from("/tmp/file.txt.bak.20250101-000000"));}@@ -1260,14 +1315,25 @@ mod tests {fn test_generate_backup_path_without_extension() {// Paths without extensions: foo -> foo.bak.TIMESTAMPlet path = PathBuf::from("/tmp/repo/feature");- let backup = super::generate_backup_path(&path, "20250101-000000");+ let backup = super::generate_backup_path(&path, "20250101-000000").unwrap();assert_eq!(backup,PathBuf::from("/tmp/repo/feature.bak.20250101-000000"));let path = PathBuf::from("/tmp/mydir");- let backup = super::generate_backup_path(&path, "20250101-000000");+ let backup = super::generate_backup_path(&path, "20250101-000000").unwrap();assert_eq!(backup, PathBuf::from("/tmp/mydir.bak.20250101-000000"));}++ #[test]+ fn test_generate_backup_path_unusual_paths() {+ // Root path has no file name+ let path = PathBuf::from("/");+ assert!(super::generate_backup_path(&path, "20250101-000000").is_err());++ // Parent reference has no file name+ let path = PathBuf::from("..");+ assert!(super::generate_backup_path(&path, "20250101-000000").is_err());+ }}diff --git a/src/main.rs b/src/main.rsindex 4bab53928..4bc681e33 100644--- a/src/main.rs+++ b/src/main.rs@@ -1,7 +1,6 @@use anyhow::Context;use clap::FromArgMatches;use color_print::cformat;-use std::path::PathBuf;use std::process;use worktrunk::config::{WorktrunkConfig, expand_template, set_config_path};use worktrunk::git::{Repository, exit_code, set_base_path};@@ -32,11 +31,11 @@ use commands::handle_select;use commands::worktree::{SwitchResult, handle_push};use commands::{MergeOptions, RebaseResult, ResolutionContext, SquashResult, add_approvals, approve_hooks,- clear_approvals, compute_worktree_path, handle_config_create, handle_config_show,+ clear_approvals, execute_switch, handle_config_create, handle_config_show,handle_configure_shell, handle_hints_clear, handle_hints_get, handle_hook_show, handle_init,handle_list, handle_merge, handle_rebase, handle_remove, handle_remove_current,handle_show_theme, handle_squash, handle_state_clear, handle_state_clear_all, handle_state_get,- handle_state_set, handle_state_show, handle_switch, handle_unconfigure_shell,+ handle_state_set, handle_state_show, handle_unconfigure_shell, plan_switch,resolve_worktree_arg, run_hook, step_commit, step_copy_ignored, step_for_each,};use output::{execute_user_command, handle_remove_output, handle_switch_output};@@ -1337,24 +1336,26 @@ fn main() {} => WorktrunkConfig::load().context("Failed to load config").and_then(|mut config| {+ let repo = Repository::current().context("Failed to switch worktree")?;++ // Validate FIRST (before approval) - fails fast if branch doesn't exist, etc.+ let plan = plan_switch(&repo, &branch, create, base.as_deref(), clobber, &config)?;+// "Approve at the Gate": collect and approve hooks upfront// This ensures approval happens once at the command entry point// If user declines, skip hooks but continue with worktree operationlet approved = if verify {- let repo = Repository::current().context("Failed to switch worktree")?;let repo_root = repo.worktree_base().context("Failed to switch worktree")?;- // Compute worktree path for template expansion in approval prompt- let worktree_path = compute_worktree_path(&repo, &branch, &config)?;let ctx = CommandContext::new(&repo,&config,- Some(&branch),- &worktree_path,+ Some(plan.branch()),+ plan.worktree_path(),&repo_root,yes,);// Approve different hooks based on whether we're creating or switching- if create {+ if plan.is_create() {approve_hooks(&ctx,&[@@ -1376,23 +1377,15 @@ fn main() {// Show message if user declined approvalif !approved {- crate::output::print(info_message(if create {+ crate::output::print(info_message(if plan.is_create() {"Commands declined, continuing worktree creation"} else {"Commands declined"}))?;}- // Execute switch operation (creates worktree, runs post-create hooks if approved)- let (result, branch_info) = handle_switch(- &branch,- create,- base.as_deref(),- yes,- clobber,- skip_hooks,- &config,- )?;+ // Execute the validated plan+ let (result, branch_info) = execute_switch(&repo, plan, &config, yes, skip_hooks)?;// Show success message (temporal locality: immediately after worktree operation)// Returns path to display in hooks when user's shell won't be in the worktree@@ -1531,143 +1524,165 @@ fn main() {.into());}- // "Approve at the Gate": collect and approve pre-remove hooks upfront- // This ensures approval happens once at the command entry point- //- // TODO(pre-remove-context): The approval context uses current worktree (cwd + current_branch),- // but hooks execute in each target worktree. When removing another worktree, the approval- // preview shows the wrong branch/path. Consider building approval context per target worktree.let repo = Repository::current().context("Failed to remove worktree")?;- let verify = if verify {- // Create context for template expansion in approval prompt- let worktree_path =- std::env::current_dir().context("Failed to get current directory")?;- let repo_root = repo.worktree_base().context("Failed to remove worktree")?;- // Keep as Option so detached HEAD maps to None -> "HEAD" via branch_or_head()- let current_branch = repo- .current_worktree()- .branch()- .context("Failed to remove worktree")?;- let ctx = CommandContext::new(- &repo,- &config,- current_branch.as_deref(),- &worktree_path,- &repo_root,- yes,- );++ // Helper: approve remove hooks using current worktree context+ // Returns true if hooks should run (user approved)+ let approve_remove = |yes: bool| -> anyhow::Result<bool> {+ use commands::context::CommandEnv;+ let env = CommandEnv::for_action_branchless()?;+ let ctx = env.context(yes);let approved =approve_hooks(&ctx, &[HookType::PreRemove, HookType::PostSwitch])?;- // If declined, skip hooks but continue with removalif !approved {crate::output::print(info_message("Commands declined, continuing removal",))?;}- approved- } else {- false+ Ok(approved)};if branches.is_empty() {- // No branches specified, remove current worktree- // Uses path-based removal to handle detached HEAD state+ // Single worktree removal: validate FIRST, then approve, then executelet result =handle_remove_current(!delete_branch, force_delete, force, &config).context("Failed to remove worktree")?;- // Approval was handled at the gate- // Post-switch hooks are spawned internally by handle_remove_output- handle_remove_output(&result, background, verify)++ // "Approve at the Gate": approval happens AFTER validation passes+ let run_hooks = verify && approve_remove(yes)?;++ handle_remove_output(&result, background, run_hooks)} else {+ use commands::worktree::RemoveResult;use worktrunk::git::ResolvedWorktree;- // When removing multiple worktrees, we need to handle the current worktree last- // to avoid deleting the directory we're currently in- let current_worktree = repo.current_worktree().root().ok();-- // Partition branches into current worktree, others, and branch-only.- // Track all errors (resolution + removal) so we can report them and continue.- let mut others = Vec::new();- let mut branch_only = Vec::new();- let mut current: Option<(PathBuf, Option<String>)> = None;++ // Multi-worktree removal: validate ALL first, then approve, then execute+ // This supports partial success - some may fail validation while others succeed.+ let current_worktree = repo+ .current_worktree()+ .root()+ .ok()+ .and_then(|p| dunce::canonicalize(&p).ok());++ // Dedupe inputs to avoid redundant planning/execution+ let branches: Vec<_> = {+ let mut seen = std::collections::HashSet::new();+ branches+ .into_iter()+ .filter(|b| seen.insert(b.clone()))+ .collect()+ };++ // Phase 1: Validate all targets (resolution + preparation)+ // Store successful plans for execution after approval+ let mut plans_others: Vec<RemoveResult> = Vec::new();+ let mut plans_branch_only: Vec<RemoveResult> = Vec::new();+ let mut plan_current: Option<RemoveResult> = None;let mut all_errors: Vec<anyhow::Error> = Vec::new();+ // Helper: record error and continue+ let mut record_error = |e: anyhow::Error| -> anyhow::Result<()> {+ output::print(e.to_string())?;+ all_errors.push(e);+ Ok(())+ };+for branch_name in &branches {- match resolve_worktree_arg(+ // Resolve the target+ let resolved = match resolve_worktree_arg(&repo,branch_name,&config,ResolutionContext::Remove,) {- Ok(ResolvedWorktree::Worktree { path, branch }) => {- if Some(&path) == current_worktree.as_ref() {- current = Some((path, branch));- } else {- others.push((path, branch));- }- }- Ok(ResolvedWorktree::BranchOnly { branch }) => {- branch_only.push(branch);- }+ Ok(r) => r,Err(e) => {- // GitError variants already include emoji via error_message() in Display- output::print(e.to_string())?;- all_errors.push(e);+ record_error(e)?;+ continue;}- }- }+ };- // Remove other worktrees first (approval was handled at the gate)- for (_path, branch) in &others {- // Branch is always Some for non-current worktrees - detached worktrees- // can only be referenced via "@" which resolves to current- let branch_name = branch- .as_ref()- .expect("non-current worktree should have branch");- match handle_remove(- branch_name,- !delete_branch,- force_delete,- force,- &config,- ) {- Ok(result) => {- handle_remove_output(&result, background, verify)?;+ match resolved {+ ResolvedWorktree::Worktree { path, branch } => {+ // Use canonical paths to avoid symlink/normalization mismatches+ let path_canonical = dunce::canonicalize(&path).unwrap_or(path);+ let is_current = current_worktree.as_ref() == Some(&path_canonical);++ if is_current {+ // Current worktree - use handle_remove_current for detached HEAD+ match handle_remove_current(+ !delete_branch,+ force_delete,+ force,+ &config,+ ) {+ Ok(result) => plan_current = Some(result),+ Err(e) => record_error(e)?,+ }+ continue;+ }++ // Non-current worktree - branch is always Some because:+ // - "@" resolves to current worktree (handled by is_current branch above)+ // - Other names resolve via resolve_worktree_arg which always sets branch: Some(...)+ let branch_for_remove = branch.as_ref().unwrap();++ match handle_remove(+ branch_for_remove,+ !delete_branch,+ force_delete,+ force,+ &config,+ ) {+ Ok(result) => plans_others.push(result),+ Err(e) => record_error(e)?,+ }}- Err(e) => {- output::print(e.to_string())?;- all_errors.push(e);+ ResolvedWorktree::BranchOnly { branch } => {+ match handle_remove(+ &branch,+ !delete_branch,+ force_delete,+ force,+ &config,+ ) {+ Ok(result) => plans_branch_only.push(result),+ Err(e) => record_error(e)?,+ }}}}- // Handle branch-only cases (no worktree)- for branch in &branch_only {- match handle_remove(branch, !delete_branch, force_delete, force, &config) {- Ok(result) => {- handle_remove_output(&result, background, verify)?;- }- Err(e) => {- output::print(e.to_string())?;- all_errors.push(e);- }- }+ // If no valid plans, bail early (all failed validation)+ let has_valid_plans = !plans_others.is_empty()+ || !plans_branch_only.is_empty()+ || plan_current.is_some();+ if !has_valid_plans {+ anyhow::bail!("");+ }++ // Phase 2: Approve hooks (only if we have valid plans)+ // TODO(pre-remove-context): Approval context uses current worktree,+ // but hooks execute in each target worktree.+ let run_hooks = verify && approve_remove(yes)?;++ // Phase 3: Execute all validated plans+ // Remove other worktrees first+ for result in plans_others {+ handle_remove_output(&result, background, run_hooks)?;+ }++ // Handle branch-only cases+ for result in plans_branch_only {+ handle_remove_output(&result, background, run_hooks)?;}// Remove current worktree last (if it was in the list)- // Post-switch hooks are spawned internally by handle_remove_output- if let Some((_path, _branch)) = current {- match handle_remove_current(!delete_branch, force_delete, force, &config) {- Ok(result) => {- handle_remove_output(&result, background, verify)?;- }- Err(e) => {- output::print(e.to_string())?;- all_errors.push(e);- }- }+ if let Some(result) = plan_current {+ handle_remove_output(&result, background, run_hooks)?;}- // Exit with failure if any errors occurred (errors already printed)+ // Exit with failure if any validation errors occurredif !all_errors.is_empty() {anyhow::bail!("");}diff --git a/src/output/handlers.rs b/src/output/handlers.rsindex 4f12d9db3..8cee7633e 100644--- a/src/output/handlers.rs+++ b/src/output/handlers.rs@@ -28,7 +28,7 @@ use super::shell_integration::{/// Format a switch message based on what was created////// # Message formats-/// - Branch + worktree created (`--create`): "Created branch X and worktree from Y @ path"+/// - Branch + worktree created (`--create`): "Created branch X from Y and worktree @ path"/// - Branch from remote + worktree (DWIM): "Created branch X (tracking remote) and worktree @ path"/// - Worktree only created: "Created worktree for X @ path"/// - Switched to existing: "Switched to worktree for X @ path"@@ -46,7 +46,7 @@ fn format_switch_message(// --create flag: created branch and worktreematch base_branch {Some(base) => cformat!(- "Created branch <bold>{branch}</> and worktree from <bold>{base}</> @ <bold>{path_display}</>"+ "Created branch <bold>{branch}</> from <bold>{base}</> and worktree @ <bold>{path_display}</>"),None => {cformat!("Created branch <bold>{branch}</> and worktree @ <bold>{path_display}</>")diff --git a/tests/integration_tests/approval_pty.rs b/tests/integration_tests/approval_pty.rsindex eedb78afa..99f2fcfab 100644--- a/tests/integration_tests/approval_pty.rs+++ b/tests/integration_tests/approval_pty.rs@@ -450,3 +450,42 @@ approved-commands = ["echo 'Second command'"]normalized);}++#[rstest]+fn test_approval_prompt_remove_decline(repo: TestRepo) {+ // Create a worktree to remove+ let output = repo+ .wt_command()+ .args(["switch", "--create", "to-remove", "--yes"])+ .output()+ .unwrap();+ assert!(output.status.success(), "Initial switch should succeed");++ // Add pre-remove hook+ repo.write_project_config(r#"pre-remove = "echo 'pre-remove hook'""#);+ repo.commit("Add pre-remove config");++ // Configure shell integration+ repo.configure_shell_integration();+ let env_vars = test_env_vars_with_shell(&repo);++ // Decline the approval prompt+ let (output, exit_code) = exec_in_pty_with_input(+ get_cargo_bin("wt").to_str().unwrap(),+ &["remove", "to-remove"],+ repo.root_path(),+ &env_vars,+ "n\n",+ );++ let normalized = normalize_output(&output);+ assert_eq!(+ exit_code, 0,+ "Remove should succeed even when hooks declined"+ );+ assert!(+ normalized.contains("Commands declined"),+ "Should show 'Commands declined' message"+ );+ assert_snapshot!("approval_prompt_remove_decline", normalized);+}diff --git a/tests/integration_tests/remove.rs b/tests/integration_tests/remove.rsindex bf3fa24ba..af0d039a6 100644--- a/tests/integration_tests/remove.rs+++ b/tests/integration_tests/remove.rs@@ -411,6 +411,19 @@ fn test_remove_no_background_deprecated(mut repo: TestRepo) {));}+/// Tests that --force-delete and --no-delete-branch are mutually exclusive+#[rstest]+fn test_remove_conflicting_branch_flags(repo: TestRepo) {+ // Try to use both --force-delete (-D) and --no-delete-branch together+ // This should fail with an error+ assert_cmd_snapshot!(make_snapshot_cmd(+ &repo,+ "remove",+ &["-D", "--no-delete-branch", "nonexistent"],+ None+ ));+}+#[rstest]fn test_remove_foreground_unmerged(mut repo: TestRepo) {// Create a worktree with an unmerged commit@@ -1407,3 +1420,22 @@ fn test_remove_path_mismatch_warning_foreground(repo: TestRepo) {None));}++#[rstest]+fn test_remove_detached_worktree_in_multi(mut repo: TestRepo) {+ // Create two worktrees+ let _feature_a = repo.add_worktree("feature-a");+ let _feature_b = repo.add_worktree("feature-b");++ // Detach HEAD in feature-b+ repo.detach_head_in_worktree("feature-b");++ // From main, try to multi-remove both+ // feature-a should succeed, feature-b should fail (detached HEAD)+ assert_cmd_snapshot!(make_snapshot_cmd(+ &repo,+ "remove",+ &["feature-a", "feature-b"],+ None+ ));+}diff --git a/tests/integration_tests/switch.rs b/tests/integration_tests/switch.rsindex 4fee1adc0..3d91efe42 100644--- a/tests/integration_tests/switch.rs+++ b/tests/integration_tests/switch.rs@@ -410,6 +410,34 @@ fn test_switch_execute_template_in_args(repo: TestRepo) {);}+#[rstest]+fn test_switch_execute_template_error(repo: TestRepo) {+ // Test that invalid templates are rejected with a clear error+ snapshot_switch(+ "switch_execute_template_error",+ &repo,+ &["--create", "error-test", "--execute", "echo {{ unclosed"],+ );+}++#[rstest]+fn test_switch_execute_arg_template_error(repo: TestRepo) {+ // Test that invalid templates in trailing args (after --) are rejected+ snapshot_switch(+ "switch_execute_arg_template_error",+ &repo,+ &[+ "--create",+ "arg-error-test",+ "--execute",+ "echo",+ "--",+ "valid={{ branch }}",+ "invalid={{ unclosed",+ ],+ );+}+// --no-verify flag tests#[rstest]fn test_switch_no_config_commands_execute_still_runs(repo: TestRepo) {diff --git a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_accept.snap b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_accept.snapindex d4b4cec2b..88481f15d 100644--- a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_accept.snap+++ b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_accept.snap@@ -12,6 +12,6 @@ y[36m◎[39m [36mRunning post-create project hook @ [1m_REPO_/repo.BRANCH[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'test command'[0m[2m[0mtest command-[32m✓[39m [32mCreated branch [1mtest-approve[22m and worktree from [1mmain[22m @ [1m_REPO_/repo.BRANCH[22m[39m+[32m✓[39m [32mCreated branch [1mtest-approve[22m from [1mmain[22m and worktree @ [1m_REPO_/repo.BRANCH[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — ran [BIN][22m; shell integration wraps [1mwt[22m[39mdiff --git a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_decline.snap b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_decline.snapindex b16bf8df0..1a8af0d9c 100644--- a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_decline.snap+++ b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_decline.snap@@ -10,6 +10,6 @@ n[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'test command'[0m[2m[36m❯[39m Allow and remember? [1m[y/N][22m[2m○[22m Commands declined, continuing worktree creation-[32m✓[39m [32mCreated branch [1mtest-decline[22m and worktree from [1mmain[22m @ [1m_REPO_/repo.BRANCH[22m[39m+[32m✓[39m [32mCreated branch [1mtest-decline[22m from [1mmain[22m and worktree @ [1m_REPO_/repo.BRANCH[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — ran [BIN][22m; shell integration wraps [1mwt[22m[39mdiff --git a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_accept.snap b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_accept.snapindex 0c732a3ea..31f67e77f 100644--- a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_accept.snap+++ b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_accept.snap@@ -20,6 +20,6 @@ y[36m◎[39m [36mRunning post-create [1mproject:third[22m @ [1m_REPO_/repo.BRANCH[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Third command'[0m[2m[0mThird command-[32m✓[39m [32mCreated branch [1mtest-mixed-accept[22m and worktree from [1mmain[22m @ [1m_REPO_/repo.BRANCH[22m[39m+[32m✓[39m [32mCreated branch [1mtest-mixed-accept[22m from [1mmain[22m and worktree @ [1m_REPO_/repo.BRANCH[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — ran [BIN][22m; shell integration wraps [1mwt[22m[39mdiff --git a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_decline.snap b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_decline.snapindex 6275cd2fc..04bd31f4e 100644--- a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_decline.snap+++ b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_decline.snap@@ -12,6 +12,6 @@ n[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Third command'[0m[2m[36m❯[39m Allow and remember? [1m[y/N][22m[2m○[22m Commands declined, continuing worktree creation-[32m✓[39m [32mCreated branch [1mtest-mixed-decline[22m and worktree from [1mmain[22m @ [1m_REPO_/repo.BRANCH[22m[39m+[32m✓[39m [32mCreated branch [1mtest-mixed-decline[22m from [1mmain[22m and worktree @ [1m_REPO_/repo.BRANCH[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — ran [BIN][22m; shell integration wraps [1mwt[22m[39mdiff --git a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_multiple_commands.snap b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_multiple_commands.snapindex a46aa5248..fc4570295 100644--- a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_multiple_commands.snap+++ b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_multiple_commands.snap@@ -22,6 +22,6 @@ y[36m◎[39m [36mRunning post-create [1mproject:third[22m @ [1m_REPO_/repo.BRANCH[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Third command'[0m[2m[0mThird command-[32m✓[39m [32mCreated branch [1mtest-multi[22m and worktree from [1mmain[22m @ [1m_REPO_/repo.BRANCH[22m[39m+[32m✓[39m [32mCreated branch [1mtest-multi[22m from [1mmain[22m and worktree @ [1m_REPO_/repo.BRANCH[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — ran [BIN][22m; shell integration wraps [1mwt[22m[39mdiff --git a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_named_commands.snap b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_named_commands.snapindex c3616ec6a..4e0a491f6 100644--- a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_named_commands.snap+++ b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_named_commands.snap@@ -22,6 +22,6 @@ y[36m◎[39m [36mRunning post-create [1mproject:test[22m @ [1m_REPO_/repo.BRANCH[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Running tests...'[0m[2m[0mRunning tests...-[32m✓[39m [32mCreated branch [1mtest-named[22m and worktree from [1mmain[22m @ [1m_REPO_/repo.BRANCH[22m[39m+[32m✓[39m [32mCreated branch [1mtest-named[22m from [1mmain[22m and worktree @ [1m_REPO_/repo.BRANCH[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — ran [BIN][22m; shell integration wraps [1mwt[22m[39mdiff --git a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_permission_error.snap b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_permission_error.snapindex 777f87475..20bf012c5 100644--- a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_permission_error.snap+++ b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_permission_error.snap@@ -14,6 +14,6 @@ y[36m◎[39m [36mRunning post-create project hook @ [1m_REPO_/repo.BRANCH[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'test command'[0m[2m[0mtest command-[32m✓[39m [32mCreated branch [1mtest-permission[22m and worktree from [1mmain[22m @ [1m_REPO_/repo.BRANCH[22m[39m+[32m✓[39m [32mCreated branch [1mtest-permission[22m from [1mmain[22m and worktree @ [1m_REPO_/repo.BRANCH[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — ran [BIN][22m; shell integration wraps [1mwt[22m[39mdiff --git a/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_remove_decline.snap b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_remove_decline.snapnew file mode 100644index 000000000..242f481f8--- /dev/null+++ b/tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_remove_decline.snap@@ -0,0 +1,13 @@+---+source: tests/integration_tests/approval_pty.rs+expression: normalized+---+n++[33m▲[39m [33m[1mrepo[22m needs approval to execute [1m1[22m command:[39m++[2m○[22m pre-remove:+[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'pre-remove hook'[0m[2m+[36m❯[39m Allow and remember? [1m[y/N][22m+[2m○[22m Commands declined, continuing removal+[36m◎ Removing [1mto-remove[22m worktree & branch in background (ancestor of [1mmain[22m,[39m [2m⊂[22m[36m)[39mdiff --git a/tests/snapshots/integration__integration_tests__approval_ui__already_approved_skip_prompt.snap b/tests/snapshots/integration__integration_tests__approval_ui__already_approved_skip_prompt.snapindex bebb2f95c..5cfa659ba 100644--- a/tests/snapshots/integration__integration_tests__approval_ui__already_approved_skip_prompt.snap+++ b/tests/snapshots/integration__integration_tests__approval_ui__already_approved_skip_prompt.snap@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -35,7 +35,7 @@ exit_code: 0----- stderr -----[36m◎[39m [36mRunning post-create project hook @ [1m_REPO_.test-approved[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'approved'[0m[2m [0m[2m[36m>[0m[2m output.txt-[0m[32m✓[39m [32mCreated branch [1mtest-approved[22m and worktree from [1mmain[22m @ [1m_REPO_.test-approved[22m[39m+[0m[32m✓[39m [32mCreated branch [1mtest-approved[22m from [1mmain[22m and worktree @ [1m_REPO_.test-approved[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__approval_ui__yes_bypasses_tty_check.snap b/tests/snapshots/integration__integration_tests__approval_ui__yes_bypasses_tty_check.snapindex 1d3e69520..e90677409 100644--- a/tests/snapshots/integration__integration_tests__approval_ui__yes_bypasses_tty_check.snap+++ b/tests/snapshots/integration__integration_tests__approval_ui__yes_bypasses_tty_check.snap@@ -10,7 +10,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -37,7 +37,7 @@ exit_code: 0[36m◎[39m [36mRunning post-create project hook @ [1m_REPO_.test-yes-tty[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'test command'[0m[2m[0mtest command-[32m✓[39m [32mCreated branch [1mtest-yes-tty[22m and worktree from [1mmain[22m @ [1m_REPO_.test-yes-tty[22m[39m+[32m✓[39m [32mCreated branch [1mtest-yes-tty[22m from [1mmain[22m and worktree @ [1m_REPO_.test-yes-tty[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__approval_ui__yes_does_not_save_approvals_first_run.snap b/tests/snapshots/integration__integration_tests__approval_ui__yes_does_not_save_approvals_first_run.snapindex f97589932..50d2fef0b 100644--- a/tests/snapshots/integration__integration_tests__approval_ui__yes_does_not_save_approvals_first_run.snap+++ b/tests/snapshots/integration__integration_tests__approval_ui__yes_does_not_save_approvals_first_run.snap@@ -10,7 +10,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -36,7 +36,7 @@ exit_code: 0----- stderr -----[36m◎[39m [36mRunning post-create project hook @ [1m_REPO_.test-yes[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'test command'[0m[2m [0m[2m[36m>[0m[2m output.txt-[0m[32m✓[39m [32mCreated branch [1mtest-yes[22m and worktree from [1mmain[22m @ [1m_REPO_.test-yes[22m[39m+[0m[32m✓[39m [32mCreated branch [1mtest-yes[22m from [1mmain[22m and worktree @ [1m_REPO_.test-yes[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__merge__readme_example_simple_switch.snap b/tests/snapshots/integration__integration_tests__merge__readme_example_simple_switch.snapindex 1cd15d958..596fe2706 100644--- a/tests/snapshots/integration__integration_tests__merge__readme_example_simple_switch.snap+++ b/tests/snapshots/integration__integration_tests__merge__readme_example_simple_switch.snap@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -33,7 +33,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mfix-auth[22m and worktree from [1mmain[22m @ [1m_REPO_.fix-auth[22m[39m+[32m✓[39m [32mCreated branch [1mfix-auth[22m from [1mmain[22m and worktree @ [1m_REPO_.fix-auth[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --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 7ff0207ef..02d28d4ba 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@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -35,7 +35,7 @@ exit_code: 0----- stderr -----[36m◎[39m [36mRunning post-create project hook @ [1m_REPO_.feature[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Setup done'[0m[2m [0m[2m[36m>[0m[2m setup.txt-[0m[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[0m[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --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 9a17edfda..92ded7208 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@@ -11,7 +11,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -35,7 +35,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mExecuting [1mecho 'Execute flag' > execute.txt[22m @ [1m_REPO_.feature[22m, but shell directory unchanged — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_base_variables.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_base_variables.snapindex a2b6d1048..858fcc46e 100644--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_base_variables.snap+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_base_variables.snap@@ -11,7 +11,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -39,7 +39,7 @@ exit_code: 0[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Base: main'[0m[2m [0m[2m[36m>[0m[2m base_info.txt[0m[36m◎[39m [36mRunning post-create [1mproject:base_path[22m @ [1m_REPO_.feature[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Base Path: _REPO_'[0m[2m [0m[2m[36m>>[0m[2m base_info.txt-[0m[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[0m[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_default_branch_template.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_default_branch_template.snapindex 0beba58f9..68edeb47d 100644--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_default_branch_template.snap+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_default_branch_template.snap@@ -10,7 +10,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -36,7 +36,7 @@ exit_code: 0----- stderr -----[36m◎[39m [36mRunning post-create project hook @ [1m_REPO_.feature[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Default: main'[0m[2m [0m[2m[36m>[0m[2m default.txt-[0m[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[0m[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --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 2d1d22d6c..fe7eeb885 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@@ -36,7 +36,7 @@ exit_code: 0[36m◎[39m [36mRunning post-create project hook @ [1m_REPO_.feature[22m:[39m[107m [0m [2m[0m[2m[34mexit[0m[2m 1[0m[31m✗[39m [31mCommand failed: exit status: 1[39m-[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_git_variables_template.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_git_variables_template.snapindex 1d9f1304e..8b09d0f42 100644--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_git_variables_template.snap+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_git_variables_template.snap@@ -10,7 +10,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -42,7 +42,7 @@ exit_code: 0[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Remote: origin'[0m[2m [0m[2m[36m>>[0m[2m git_vars.txt[0m[36m◎[39m [36mRunning post-create [1mproject:worktree_name[22m @ [1m_REPO_.feature[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Worktree Name: repo.feature'[0m[2m [0m[2m[36m>>[0m[2m git_vars.txt-[0m[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[0m[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiline_control_structure.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiline_control_structure.snapindex 054fa4281..74b86b70f 100644--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiline_control_structure.snap+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_multiline_control_structure.snap@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -39,6 +39,6 @@ exit_code: 0[107m [0m [2m[0m[2m[34melse[0m[2m[107m [0m [2m [0m[2m[34mecho[0m[2m [0m[2m[32m'File exists'[0m[2m [0m[2m[36m>[0m[2m result.txt[107m [0m [2m[0m[2m[34mfi[0m[2m-[0m[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[0m[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --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 c70c20505..93270b0c1 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@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -39,7 +39,7 @@ exit_code: 0[36m◎[39m [36mRunning post-create [1mproject:setup[22m @ [1m_REPO_.feature[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Running setup'[0m[2m[0mRunning setup-[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --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 d93ead831..4400599cb 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@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -33,7 +33,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --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 b3e7640a8..5c9946475 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@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -36,7 +36,7 @@ exit_code: 0[36m◎[39m [36mRunning post-create project hook @ [1m_REPO_.feature[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Setup complete'[0m[2m[0mSetup complete-[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --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 f6e0d950a..7f034b0ed 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@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -43,6 +43,6 @@ exit_code: 0[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Worktree: _REPO_.feature-test'[0m[2m [0m[2m[36m>>[0m[2m info.txt[0m[36m◎[39m [36mRunning post-create [1mproject:root[22m @ [1m_REPO_.feature-test[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Root: _REPO_'[0m[2m [0m[2m[36m>>[0m[2m info.txt-[0m[32m✓[39m [32mCreated branch [1mfeature/test[22m and worktree from [1mmain[22m @ [1m_REPO_.feature-test[22m[39m+[0m[32m✓[39m [32mCreated branch [1mfeature/test[22m from [1mmain[22m and worktree @ [1m_REPO_.feature-test[22m[39m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_upstream_template.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_upstream_template.snapindex 1a0af6ef3..5f06fa96a 100644--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_create_upstream_template.snap+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_create_upstream_template.snap@@ -10,7 +10,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -36,7 +36,7 @@ exit_code: 0----- stderr -----[36m◎[39m [36mRunning post-create project hook @ [1m_REPO_.feature[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Upstream: '[0m[2m [0m[2m[36m>[0m[2m upstream.txt-[0m[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[0m[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --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 82854f53c..cce08249e 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@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -33,7 +33,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_create_with_command.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_create_with_command.snapindex 3afa129ea..55a277fe9 100644--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_create_with_command.snap+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_create_with_command.snap@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -33,7 +33,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --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 f31c605dd..b120b631d 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@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -33,7 +33,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --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 8978b41a4..4c80575e1 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@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -33,7 +33,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiline_with_newlines.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiline_with_newlines.snapindex eacead26a..9e55dfd86 100644--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiline_with_newlines.snap+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_multiline_with_newlines.snap@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -33,7 +33,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m[36m◎[39m [36mRunning post-start project hook @ [1m_REPO_.feature[22m:[39mdiff --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 cb4314430..cb0641722 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@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -33,7 +33,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --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 0d1b18e5d..1a1a6ab21 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@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -33,7 +33,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --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 fa951f25d..cf577c24b 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@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -33,7 +33,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__remove__remove_at_from_detached_head_in_worktree.snap b/tests/snapshots/integration__integration_tests__remove__remove_at_from_detached_head_in_worktree.snapindex 8bb028fb3..37ff68d8c 100644--- a/tests/snapshots/integration__integration_tests__remove__remove_at_from_detached_head_in_worktree.snap+++ b/tests/snapshots/integration__integration_tests__remove__remove_at_from_detached_head_in_worktree.snap@@ -8,7 +8,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"diff --git a/tests/snapshots/integration__integration_tests__remove__remove_conflicting_branch_flags.snap b/tests/snapshots/integration__integration_tests__remove__remove_conflicting_branch_flags.snapnew file mode 100644index 000000000..e7a090e9b--- /dev/null+++ b/tests/snapshots/integration__integration_tests__remove__remove_conflicting_branch_flags.snap@@ -0,0 +1,37 @@+---+source: tests/integration_tests/remove.rs+info:+ program: wt+ args:+ - remove+ - "-D"+ - "--no-delete-branch"+ - nonexistent+ env:+ APPDATA: "[TEST_CONFIG_HOME]"+ CLICOLOR_FORCE: "1"+ COLUMNS: "500"+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"+ GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"+ GIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""+ GIT_TERMINAL_PROMPT: "0"+ HOME: "[TEST_HOME]"+ LANG: C+ LC_ALL: C+ PATH: "[PATH]"+ RUST_LOG: warn+ SOURCE_DATE_EPOCH: "1735776000"+ TERM: alacritty+ USERPROFILE: "[TEST_HOME]"+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"+ XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"+---+success: false+exit_code: 1+----- stdout -----++----- stderr -----+[31m✗[39m [31mCannot use --force-delete with --no-delete-branch[39mdiff --git a/tests/snapshots/integration__integration_tests__remove__remove_detached_worktree_in_multi.snap b/tests/snapshots/integration__integration_tests__remove__remove_detached_worktree_in_multi.snapnew file mode 100644index 000000000..a692cb172--- /dev/null+++ b/tests/snapshots/integration__integration_tests__remove__remove_detached_worktree_in_multi.snap@@ -0,0 +1,38 @@+---+source: tests/integration_tests/remove.rs+info:+ program: wt+ args:+ - remove+ - feature-a+ - feature-b+ env:+ APPDATA: "[TEST_CONFIG_HOME]"+ CLICOLOR_FORCE: "1"+ COLUMNS: "500"+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"+ GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"+ GIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""+ GIT_TERMINAL_PROMPT: "0"+ HOME: "[TEST_HOME]"+ LANG: C+ LC_ALL: C+ PATH: "[PATH]"+ RUST_LOG: warn+ SOURCE_DATE_EPOCH: "1735776000"+ TERM: alacritty+ USERPROFILE: "[TEST_HOME]"+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"+ XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"+---+success: true+exit_code: 0+----- stdout -----++----- stderr -----+[36m◎ Removing [1mfeature-a[22m worktree & branch in background (same commit as [1mmain[22m,[39m [2m_[22m[36m)[39m+[33m▲[39m [33mNo worktree found for branch [1mfeature-b[22m[39m+[32m✓ Removed branch [1mfeature-b[22m (same commit as [1mmain[22m,[39m [2m_[22m[32m)[39mdiff --git a/tests/snapshots/integration__integration_tests__remove__remove_locked_detached_multi.snap b/tests/snapshots/integration__integration_tests__remove__remove_locked_detached_multi.snapindex cc9c118ac..b96eed734 100644--- a/tests/snapshots/integration__integration_tests__remove__remove_locked_detached_multi.snap+++ b/tests/snapshots/integration__integration_tests__remove__remove_locked_detached_multi.snap@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -33,6 +33,6 @@ exit_code: 1----- stdout ---------- stderr ------[36m◎ Removing [1mother[22m worktree & branch in background (same commit as [1mmain[22m,[39m [2m_[22m[36m)[39m[31m✗[39m [31mCannot remove [1mrepo.locked-detached[22m, worktree is locked (Locked detached)[39m[2m↳[22m [2mTo unlock, run [90mgit worktree unlock _REPO_.locked-detached[39m[22m+[36m◎ Removing [1mother[22m worktree & branch in background (same commit as [1mmain[22m,[39m [2m_[22m[36m)[39mdiff --git a/tests/snapshots/integration__integration_tests__remove__remove_partial_success.snap b/tests/snapshots/integration__integration_tests__remove__remove_partial_success.snapindex d3dc2c488..beb4bf170 100644--- a/tests/snapshots/integration__integration_tests__remove__remove_partial_success.snap+++ b/tests/snapshots/integration__integration_tests__remove__remove_partial_success.snap@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -33,5 +33,5 @@ exit_code: 1----- stdout ---------- stderr ------[36m◎ Removing [1mfeature[22m worktree & branch in background (same commit as [1mmain[22m,[39m [2m_[22m[36m)[39m[31m✗[39m [31mNo worktree found for branch [1mnonexistent[22m[39m+[36m◎ Removing [1mfeature[22m worktree & branch in background (same commit as [1mmain[22m,[39m [2m_[22m[36m)[39mdiff --git a/tests/snapshots/integration__integration_tests__shell_integration_prompt__pty_tests__prompt_accept.snap b/tests/snapshots/integration__integration_tests__shell_integration_prompt__pty_tests__prompt_accept.snapindex e24c32c47..b0a2437cb 100644--- a/tests/snapshots/integration__integration_tests__shell_integration_prompt__pty_tests__prompt_accept.snap+++ b/tests/snapshots/integration__integration_tests__shell_integration_prompt__pty_tests__prompt_accept.snap@@ -4,7 +4,7 @@ expression: normalized---y-[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m[REPO]/repo.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m[REPO]/repo.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39mdiff --git a/tests/snapshots/integration__integration_tests__shell_integration_prompt__pty_tests__prompt_decline.snap b/tests/snapshots/integration__integration_tests__shell_integration_prompt__pty_tests__prompt_decline.snapindex be84fcbd4..f3f8773f6 100644--- a/tests/snapshots/integration__integration_tests__shell_integration_prompt__pty_tests__prompt_decline.snap+++ b/tests/snapshots/integration__integration_tests__shell_integration_prompt__pty_tests__prompt_decline.snap@@ -4,7 +4,7 @@ expression: normalized---n-[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m[REPO]/repo.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m[REPO]/repo.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39mdiff --git a/tests/snapshots/integration__integration_tests__shell_integration_prompt__pty_tests__prompt_preview_decline.snap b/tests/snapshots/integration__integration_tests__shell_integration_prompt__pty_tests__prompt_preview_decline.snapindex bd2eb5c9d..d275c3a61 100644--- a/tests/snapshots/integration__integration_tests__shell_integration_prompt__pty_tests__prompt_preview_decline.snap+++ b/tests/snapshots/integration__integration_tests__shell_integration_prompt__pty_tests__prompt_preview_decline.snap@@ -5,7 +5,7 @@ expression: normalized?n-[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m[REPO]/repo.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m[REPO]/repo.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39mdiff --git a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__bash_shell_integration_hint_suppressed.snap b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__bash_shell_integration_hint_suppressed.snapindex 592645d0d..3b8730083 100644--- a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__bash_shell_integration_hint_suppressed.snap+++ b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__bash_shell_integration_hint_suppressed.snap@@ -2,5 +2,5 @@source: tests/integration_tests/shell_wrapper.rsexpression: output.normalized()----[32m✓[39m [32mCreated branch [1mbash-test[22m and worktree from [1mmain[22m @ [1m[TMPDIR]/repo.bash-test[22m[39m+[32m✓[39m [32mCreated branch [1mbash-test[22m from [1mmain[22m and worktree @ [1m[TMPDIR]/repo.bash-test[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_multiline_command_execution.snap b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_multiline_command_execution.snapindex 1213e287a..7e4adfc61 100644--- a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_multiline_command_execution.snap+++ b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_multiline_command_execution.snap@@ -2,7 +2,7 @@source: tests/integration_tests/shell_wrapper.rsexpression: output.normalized()----[32m✓[39m [32mCreated branch [1mfish-multiline[22m and worktree from [1mmain[22m @ [1m[TMPDIR]/repo.fish-multiline[22m[39m+[32m✓[39m [32mCreated branch [1mfish-multiline[22m from [1mmain[22m and worktree @ [1m[TMPDIR]/repo.fish-multiline[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[36m◎[39m [36mExecuting (--execute):[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'line 1'[0m[2m; [0m[2m[34mecho[0m[2m [0m[2m[32m'line 2'[0m[2m; [0m[2m[34mecho[0m[2m [0m[2m[32m'line 3'[0m[2mdiff --git a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_wrapper_handles_empty_chunks.snap b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_wrapper_handles_empty_chunks.snapindex b0e72ca3f..824a18077 100644--- a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_wrapper_handles_empty_chunks.snap+++ b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_wrapper_handles_empty_chunks.snap@@ -2,5 +2,5 @@source: tests/integration_tests/shell_wrapper.rsexpression: output.normalized()----[32m✓[39m [32mCreated branch [1mfish-minimal[22m and worktree from [1mmain[22m @ [1m[TMPDIR]/repo.fish-minimal[22m[39m+[32m✓[39m [32mCreated branch [1mfish-minimal[22m from [1mmain[22m and worktree @ [1m[TMPDIR]/repo.fish-minimal[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_wrapper_preserves_progress_messages.snap b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_wrapper_preserves_progress_messages.snapindex 18316fc8c..267e0a79b 100644--- a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_wrapper_preserves_progress_messages.snap+++ b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_wrapper_preserves_progress_messages.snap@@ -2,7 +2,7 @@source: tests/integration_tests/shell_wrapper.rsexpression: output.normalized()----[32m✓[39m [32mCreated branch [1mfish-bg[22m and worktree from [1mmain[22m @ [1m[TMPDIR]/repo.fish-bg[22m[39m+[32m✓[39m [32mCreated branch [1mfish-bg[22m from [1mmain[22m and worktree @ [1m[TMPDIR]/repo.fish-bg[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[36m◎[39m [36mRunning post-start project hook:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'fish background task'[0m[2mdiff --git a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_hooks_post_create.snap b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_hooks_post_create.snapindex e14908ae1..dda5f6aeb 100644--- a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_hooks_post_create.snap+++ b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_hooks_post_create.snap@@ -7,7 +7,7 @@ expression: output.normalized()Resolved 24 packages in 145msInstalled 24 packages in 1.2s-[32m✓[39m [32mCreated branch [1mfeature-x[22m and worktree from [1mmain[22m @ [1m[TMPDIR]/repo.feature-x[22m[39m+[32m✓[39m [32mCreated branch [1mfeature-x[22m from [1mmain[22m and worktree @ [1m[TMPDIR]/repo.feature-x[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[36m◎[39m [36mRunning post-start [1mproject:dev[22m:[39m[107m [0m [2m[0m[2m[34muv[0m[2m run devdiff --git a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_simple_switch.snap b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_simple_switch.snapindex e41a73327..ac5182bc9 100644--- a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_simple_switch.snap+++ b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_simple_switch.snap@@ -2,5 +2,5 @@source: tests/integration_tests/shell_wrapper.rsexpression: output.normalized()----[32m✓[39m [32mCreated branch [1mfix-auth[22m and worktree from [1mmain[22m @ [1m[TMPDIR]/repo.fix-auth[22m[39m+[32m✓[39m [32mCreated branch [1mfix-auth[22m from [1mmain[22m and worktree @ [1m[TMPDIR]/repo.fix-auth[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_create.snap b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_create.snapindex e3142f7ee..68f2e5752 100644--- a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_create.snap+++ b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_create.snap@@ -2,5 +2,5 @@source: tests/integration_tests/shell_wrapper.rsexpression: output.normalized()----[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m[TMPDIR]/repo.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m[TMPDIR]/repo.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_execute.snap b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_execute.snapindex 5176f18e8..6f5c023e0 100644--- a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_execute.snap+++ b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_execute.snap@@ -2,7 +2,7 @@source: tests/integration_tests/shell_wrapper.rsexpression: output.normalized()----[32m✓[39m [32mCreated branch [1mtest-exec[22m and worktree from [1mmain[22m @ [1m[TMPDIR]/repo.test-exec[22m[39m+[32m✓[39m [32mCreated branch [1mtest-exec[22m from [1mmain[22m and worktree @ [1m[TMPDIR]/repo.test-exec[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[36m◎[39m [36mExecuting (--execute):[39m[107m [0m [2m[0m[2m[34mecho[0m[2m executeddiff --git a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_execute_through_wrapper.snap b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_execute_through_wrapper.snapindex 5176f18e8..6f5c023e0 100644--- a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_execute_through_wrapper.snap+++ b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_execute_through_wrapper.snap@@ -2,7 +2,7 @@source: tests/integration_tests/shell_wrapper.rsexpression: output.normalized()----[32m✓[39m [32mCreated branch [1mtest-exec[22m and worktree from [1mmain[22m @ [1m[TMPDIR]/repo.test-exec[22m[39m+[32m✓[39m [32mCreated branch [1mtest-exec[22m from [1mmain[22m and worktree @ [1m[TMPDIR]/repo.test-exec[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[36m◎[39m [36mExecuting (--execute):[39m[107m [0m [2m[0m[2m[34mecho[0m[2m executeddiff --git a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_zsh.snap b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_zsh.snapindex 447a732fc..48b49c78c 100644--- a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_zsh.snap+++ b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_hooks_zsh.snap@@ -8,7 +8,7 @@ Installing dependencies...[36m◎[39m [36mRunning post-create [1mproject:build[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Building project...'[0m[2mBuilding project...-[32m✓[39m [32mCreated branch [1mfeature-hooks[22m and worktree from [1mmain[22m @ [1m[TMPDIR]/repo.feature-hooks[22m[39m+[32m✓[39m [32mCreated branch [1mfeature-hooks[22m from [1mmain[22m and worktree @ [1m[TMPDIR]/repo.feature-hooks[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[36m◎[39m [36mRunning post-start [1mproject:server[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Starting dev server on port 3000'[0m[2mdiff --git a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_post_start_command_no_directive_leak.snap b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_post_start_command_no_directive_leak.snapindex 0b1cc7b32..0527ca1b5 100644--- a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_post_start_command_no_directive_leak.snap+++ b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_post_start_command_no_directive_leak.snap@@ -2,7 +2,7 @@source: tests/integration_tests/shell_wrapper.rsexpression: output.normalized()----[32m✓[39m [32mCreated branch [1mfeature-with-hooks[22m and worktree from [1mmain[22m @ [1m[TMPDIR]/repo.feature-with-hooks[22m[39m+[32m✓[39m [32mCreated branch [1mfeature-with-hooks[22m from [1mmain[22m and worktree @ [1m[TMPDIR]/repo.feature-with-hooks[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[36m◎[39m [36mRunning post-start project hook:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'test command executed'[0m[2mdiff --git a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__wrapper_preserves_progress_messages.snap b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__wrapper_preserves_progress_messages.snapindex 66b9f85b6..9cb10e9c1 100644--- a/tests/snapshots/integration__integration_tests__shell_wrapper__tests__wrapper_preserves_progress_messages.snap+++ b/tests/snapshots/integration__integration_tests__shell_wrapper__tests__wrapper_preserves_progress_messages.snap@@ -2,7 +2,7 @@source: tests/integration_tests/shell_wrapper.rsexpression: output.normalized()----[32m✓[39m [32mCreated branch [1mfeature-bg[22m and worktree from [1mmain[22m @ [1m[TMPDIR]/repo.feature-bg[22m[39m+[32m✓[39m [32mCreated branch [1mfeature-bg[22m from [1mmain[22m and worktree @ [1m[TMPDIR]/repo.feature-bg[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[36m◎[39m [36mRunning post-start project hook:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'background task'[0m[2mdiff --git a/tests/snapshots/integration__integration_tests__switch__create_with_base_main.snap b/tests/snapshots/integration__integration_tests__switch__create_with_base_main.snapindex 9bf6a69f0..4feebd73b 100644--- a/tests/snapshots/integration__integration_tests__switch__create_with_base_main.snap+++ b/tests/snapshots/integration__integration_tests__switch__create_with_base_main.snap@@ -11,7 +11,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -35,7 +35,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mnew-feature[22m and worktree from [1mmain[22m @ [1m_REPO_.new-feature[22m[39m+[32m✓[39m [32mCreated branch [1mnew-feature[22m from [1mmain[22m and worktree @ [1m_REPO_.new-feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_clobber_path_with_extension.snap b/tests/snapshots/integration__integration_tests__switch__switch_clobber_path_with_extension.snapindex cbdeed838..afd6c9eac 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_clobber_path_with_extension.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_clobber_path_with_extension.snap@@ -35,7 +35,7 @@ exit_code: 0----- stderr -----[33m▲[39m [33mMoving [1m_REPO_.clobber-ext.txt[22m to [1m_REPO_.clobber-ext.txt.bak.20250102-000000[22m (--clobber)[39m-[32m✓[39m [32mCreated branch [1mclobber-ext.txt[22m and worktree from [1mmain[22m @ [1m_REPO_.clobber-ext.txt[22m[39m+[32m✓[39m [32mCreated branch [1mclobber-ext.txt[22m from [1mmain[22m and worktree @ [1m_REPO_.clobber-ext.txt[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_clobber_removes_stale_dir.snap b/tests/snapshots/integration__integration_tests__switch__switch_clobber_removes_stale_dir.snapindex d23c72d9f..27fcc7fff 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_clobber_removes_stale_dir.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_clobber_removes_stale_dir.snap@@ -35,7 +35,7 @@ exit_code: 0----- stderr -----[33m▲[39m [33mMoving [1m_REPO_.clobber-dir-test[22m to [1m_REPO_.clobber-dir-test.bak.20250102-000000[22m (--clobber)[39m-[32m✓[39m [32mCreated branch [1mclobber-dir-test[22m and worktree from [1mmain[22m @ [1m_REPO_.clobber-dir-test[22m[39m+[32m✓[39m [32mCreated branch [1mclobber-dir-test[22m from [1mmain[22m and worktree @ [1m_REPO_.clobber-dir-test[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_clobber_removes_stale_file.snap b/tests/snapshots/integration__integration_tests__switch__switch_clobber_removes_stale_file.snapindex d3029c7d2..67e665340 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_clobber_removes_stale_file.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_clobber_removes_stale_file.snap@@ -35,7 +35,7 @@ exit_code: 0----- stderr -----[33m▲[39m [33mMoving [1m_REPO_.clobber-file-test[22m to [1m_REPO_.clobber-file-test.bak.20250102-000000[22m (--clobber)[39m-[32m✓[39m [32mCreated branch [1mclobber-file-test[22m and worktree from [1mmain[22m @ [1m_REPO_.clobber-file-test[22m[39m+[32m✓[39m [32mCreated branch [1mclobber-file-test[22m from [1mmain[22m and worktree @ [1m_REPO_.clobber-file-test[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_create_new.snap b/tests/snapshots/integration__integration_tests__switch__switch_create_new.snapindex a3558afba..10cf5d33a 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_create_new.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_create_new.snap@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -33,7 +33,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mfeature-x[22m and worktree from [1mmain[22m @ [1m_REPO_.feature-x[22m[39m+[32m✓[39m [32mCreated branch [1mfeature-x[22m from [1mmain[22m and worktree @ [1m_REPO_.feature-x[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_create_no_remote.snap b/tests/snapshots/integration__integration_tests__switch__switch_create_no_remote.snapindex 17efdcafb..526c54f27 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_create_no_remote.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_create_no_remote.snap@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -33,7 +33,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_create_remote_only.snap b/tests/snapshots/integration__integration_tests__switch__switch_create_remote_only.snapindex c4013753f..157a871d9 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_create_remote_only.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_create_remote_only.snap@@ -35,7 +35,7 @@ exit_code: 0----- stderr -----[33m▲[39m [33mBranch [1mremote-feature[22m exists on remote (origin/remote-feature); creating new branch from base instead[39m[2m↳[22m [2mTo switch to the remote branch, remove this added branch and then run without [90m--create[39m: [90mwt remove remote-feature && wt switch remote-feature[39m[22m-[32m✓[39m [32mCreated branch [1mremote-feature[22m and worktree from [1mmain[22m @ [1m_REPO_.remote-feature[22m[39m+[32m✓[39m [32mCreated branch [1mremote-feature[22m from [1mmain[22m and worktree @ [1m_REPO_.remote-feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_arg_template_error.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_arg_template_error.snapnew file mode 100644index 000000000..6d70dab8a--- /dev/null+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_arg_template_error.snap@@ -0,0 +1,45 @@+---+source: tests/integration_tests/switch.rs+info:+ program: wt+ args:+ - switch+ - "--create"+ - arg-error-test+ - "--execute"+ - echo+ - "--"+ - "valid={{ branch }}"+ - "invalid={{ unclosed"+ env:+ APPDATA: "[TEST_CONFIG_HOME]"+ CLICOLOR_FORCE: "1"+ COLUMNS: "500"+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"+ GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"+ GIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""+ GIT_TERMINAL_PROMPT: "0"+ HOME: "[TEST_HOME]"+ LANG: C+ LC_ALL: C+ PATH: "[PATH]"+ RUST_LOG: warn+ SOURCE_DATE_EPOCH: "1735776000"+ TERM: alacritty+ USERPROFILE: "[TEST_HOME]"+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"+ XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"+---+success: false+exit_code: 1+----- stdout -----++----- stderr -----+[32m✓[39m [32mCreated branch [1marg-error-test[22m from [1mmain[22m and worktree @ [1m_REPO_.arg-error-test[22m[39m+[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m+[33m▲[39m [33mExecuting [1mecho[22m @ [1m_REPO_.arg-error-test[22m, but shell directory unchanged — shell integration not installed[39m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m+[31m✗[39m [31mFailed to expand argument template: Template syntax error: syntax error: unexpected end of input, expected end of variable block (in <string>:1)[39mdiff --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 ced18c878..9af3f0bf2 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@@ -11,7 +11,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -35,7 +35,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mfile-test[22m and worktree from [1mmain[22m @ [1m_REPO_.file-test[22m[39m+[32m✓[39m [32mCreated branch [1mfile-test[22m from [1mmain[22m and worktree @ [1m_REPO_.file-test[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mExecuting [1mecho 'test content' > test.txt[22m @ [1m_REPO_.file-test[22m, but shell directory unchanged — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_failure.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_failure.snapindex 5f9079c6b..86380a077 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_failure.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_failure.snap@@ -11,7 +11,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -35,7 +35,7 @@ exit_code: 1----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mfail-test[22m and worktree from [1mmain[22m @ [1m_REPO_.fail-test[22m[39m+[32m✓[39m [32mCreated branch [1mfail-test[22m from [1mmain[22m and worktree @ [1m_REPO_.fail-test[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mExecuting [1mexit 1[22m @ [1m_REPO_.fail-test[22m, but shell directory unchanged — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_multiline.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_multiline.snapindex 2aab6f309..842d68e39 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_multiline.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_multiline.snap@@ -11,7 +11,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -38,7 +38,7 @@ line2line3----- stderr ------[32m✓[39m [32mCreated branch [1mmultiline-test[22m and worktree from [1mmain[22m @ [1m_REPO_.multiline-test[22m[39m+[32m✓[39m [32mCreated branch [1mmultiline-test[22m from [1mmain[22m and worktree @ [1m_REPO_.multiline-test[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mExecuting [1mecho 'line1'echo 'line2'diff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_success.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_success.snapindex 2dbda72e2..bb3704425 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_success.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_success.snap@@ -11,7 +11,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -36,7 +36,7 @@ exit_code: 0test output----- stderr ------[32m✓[39m [32mCreated branch [1mexec-test[22m and worktree from [1mmain[22m @ [1m_REPO_.exec-test[22m[39m+[32m✓[39m [32mCreated branch [1mexec-test[22m from [1mmain[22m and worktree @ [1m_REPO_.exec-test[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mExecuting [1mecho 'test output'[22m @ [1m_REPO_.exec-test[22m, but shell directory unchanged — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_template_base.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_template_base.snapindex 42c250c00..503fc161d 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_template_base.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_template_base.snap@@ -38,7 +38,7 @@ exit_code: 0base=main----- stderr ------[32m✓[39m [32mCreated branch [1mfrom-main[22m and worktree from [1mmain[22m @ [1m_REPO_.from-main[22m[39m+[32m✓[39m [32mCreated branch [1mfrom-main[22m from [1mmain[22m and worktree @ [1m_REPO_.from-main[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mExecuting [1mecho 'base={{ base }}'[22m @ [1m_REPO_.from-main[22m, but shell directory unchanged — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_template_branch.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_template_branch.snapindex 375f3a3ac..a50704e77 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_template_branch.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_template_branch.snap@@ -36,7 +36,7 @@ exit_code: 0branch=template-test----- stderr ------[32m✓[39m [32mCreated branch [1mtemplate-test[22m and worktree from [1mmain[22m @ [1m_REPO_.template-test[22m[39m+[32m✓[39m [32mCreated branch [1mtemplate-test[22m from [1mmain[22m and worktree @ [1m_REPO_.template-test[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mExecuting [1mecho 'branch={{ branch }}'[22m @ [1m_REPO_.template-test[22m, but shell directory unchanged — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_template_error.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_template_error.snapnew file mode 100644index 000000000..45badf68e--- /dev/null+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_template_error.snap@@ -0,0 +1,42 @@+---+source: tests/integration_tests/switch.rs+info:+ program: wt+ args:+ - switch+ - "--create"+ - error-test+ - "--execute"+ - "echo {{ unclosed"+ env:+ APPDATA: "[TEST_CONFIG_HOME]"+ CLICOLOR_FORCE: "1"+ COLUMNS: "500"+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"+ GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"+ GIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""+ GIT_TERMINAL_PROMPT: "0"+ HOME: "[TEST_HOME]"+ LANG: C+ LC_ALL: C+ PATH: "[PATH]"+ RUST_LOG: warn+ SOURCE_DATE_EPOCH: "1735776000"+ TERM: alacritty+ USERPROFILE: "[TEST_HOME]"+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"+ XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"+---+success: false+exit_code: 1+----- stdout -----++----- stderr -----+[32m✓[39m [32mCreated branch [1merror-test[22m from [1mmain[22m and worktree @ [1m_REPO_.error-test[22m[39m+[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m+[33m▲[39m [33mExecuting [1mecho {{ unclosed[22m @ [1m_REPO_.error-test[22m, but shell directory unchanged — shell integration not installed[39m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m+[31m✗[39m [31mFailed to expand --execute template: Template syntax error: syntax error: unexpected end of input, expected end of variable block (in <string>:1)[39mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_template_in_args.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_template_in_args.snapindex 2097f3abe..0f186d76c 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_template_in_args.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_template_in_args.snap@@ -39,7 +39,7 @@ exit_code: 0branch=args-test repo=repo----- stderr ------[32m✓[39m [32mCreated branch [1margs-test[22m and worktree from [1mmain[22m @ [1m_REPO_.args-test[22m[39m+[32m✓[39m [32mCreated branch [1margs-test[22m from [1mmain[22m and worktree @ [1m_REPO_.args-test[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mExecuting [1mecho[22m @ [1m_REPO_.args-test[22m, but shell directory unchanged — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_template_shell_escape.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_template_shell_escape.snapindex c31d856ae..d320dcfea 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_template_shell_escape.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_template_shell_escape.snap@@ -36,7 +36,7 @@ exit_code: 0feat;id----- stderr ------[32m✓[39m [32mCreated branch [1mfeat;id[22m and worktree from [1mmain[22m @ [1m_REPO_.feat;id[22m[39m+[32m✓[39m [32mCreated branch [1mfeat;id[22m from [1mmain[22m and worktree @ [1m_REPO_.feat;id[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mExecuting [1mecho {{ branch }}[22m @ [1m_REPO_.feat;id[22m, but shell directory unchanged — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_template_with_filter.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_template_with_filter.snapindex 4384dc902..ffc0f7028 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_template_with_filter.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_template_with_filter.snap@@ -36,7 +36,7 @@ exit_code: 0sanitized=feature-with-slash----- stderr ------[32m✓[39m [32mCreated branch [1mfeature/with-slash[22m and worktree from [1mmain[22m @ [1m_REPO_.feature-with-slash[22m[39m+[32m✓[39m [32mCreated branch [1mfeature/with-slash[22m from [1mmain[22m and worktree @ [1m_REPO_.feature-with-slash[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mExecuting [1mecho 'sanitized={{ branch | sanitize }}'[22m @ [1m_REPO_.feature-with-slash[22m, but shell directory unchanged — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_template_worktree_path.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_template_worktree_path.snapindex 9c5bb29ce..05fd56b99 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_template_worktree_path.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_template_worktree_path.snap@@ -36,7 +36,7 @@ exit_code: 0path=_REPO_.path-test----- stderr ------[32m✓[39m [32mCreated branch [1mpath-test[22m and worktree from [1mmain[22m @ [1m_REPO_.path-test[22m[39m+[32m✓[39m [32mCreated branch [1mpath-test[22m from [1mmain[22m and worktree @ [1m_REPO_.path-test[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mExecuting [1mecho 'path={{ worktree_path }}'[22m @ [1m_REPO_.path-test[22m, but shell directory unchanged — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_internal_execute_exit_code.snap b/tests/snapshots/integration__integration_tests__switch__switch_internal_execute_exit_code.snapindex 2729d05ce..a96ce3094 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_internal_execute_exit_code.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_internal_execute_exit_code.snap@@ -11,7 +11,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -36,7 +36,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mexit-code-test[22m and worktree from [1mmain[22m @ [1m_REPO_.exit-code-test[22m[39m+[32m✓[39m [32mCreated branch [1mexit-code-test[22m from [1mmain[22m and worktree @ [1m_REPO_.exit-code-test[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[36m◎[39m [36mExecuting (--execute):[39m[107m [0m [2m[0m[2m[34mexit[0m[2m 42diff --git a/tests/snapshots/integration__integration_tests__switch__switch_internal_execute_output_then_exit.snap b/tests/snapshots/integration__integration_tests__switch__switch_internal_execute_output_then_exit.snapindex 6ceba852b..ddce56376 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_internal_execute_output_then_exit.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_internal_execute_output_then_exit.snap@@ -11,7 +11,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -36,7 +36,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1moutput-exit-test[22m and worktree from [1mmain[22m @ [1m_REPO_.output-exit-test[22m[39m+[32m✓[39m [32mCreated branch [1moutput-exit-test[22m from [1mmain[22m and worktree @ [1m_REPO_.output-exit-test[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[36m◎[39m [36mExecuting (--execute):[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'doing work'[0m[2mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_internal_mode.snap b/tests/snapshots/integration__integration_tests__switch__switch_internal_mode.snapindex 71d3be35b..8776133f6 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_internal_mode.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_internal_mode.snap@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -34,5 +34,5 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1minternal-test[22m and worktree from [1mmain[22m @ [1m_REPO_.internal-test[22m[39m+[32m✓[39m [32mCreated branch [1minternal-test[22m from [1mmain[22m and worktree @ [1m_REPO_.internal-test[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22mdiff --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 44a6778d0..25ff8b989 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_internal_with_execute.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_internal_with_execute.snap@@ -11,7 +11,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -36,7 +36,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mexec-internal[22m and worktree from [1mmain[22m @ [1m_REPO_.exec-internal[22m[39m+[32m✓[39m [32mCreated branch [1mexec-internal[22m from [1mmain[22m and worktree @ [1m_REPO_.exec-internal[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[36m◎[39m [36mExecuting (--execute):[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'line1'[0m[2mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_execute_still_runs.snap b/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_execute_still_runs.snapindex 6bbf4897f..9b8fb3a65 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_execute_still_runs.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_execute_still_runs.snap@@ -12,7 +12,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -37,7 +37,7 @@ exit_code: 0execute command runs----- stderr ------[32m✓[39m [32mCreated branch [1mno-hooks-test[22m and worktree from [1mmain[22m @ [1m_REPO_.no-hooks-test[22m[39m+[32m✓[39m [32mCreated branch [1mno-hooks-test[22m from [1mmain[22m and worktree @ [1m_REPO_.no-hooks-test[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mExecuting [1mecho 'execute command runs'[22m @ [1m_REPO_.no-hooks-test[22m, but shell directory unchanged — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_skips_post_start.snap b/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_skips_post_start.snapindex a31226ddc..a43aca254 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_skips_post_start.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_skips_post_start.snap@@ -10,7 +10,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -34,7 +34,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mno-post-start[22m and worktree from [1mmain[22m @ [1m_REPO_.no-post-start[22m[39m+[32m✓[39m [32mCreated branch [1mno-post-start[22m from [1mmain[22m and worktree @ [1m_REPO_.no-post-start[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_with_yes.snap b/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_with_yes.snapindex b08fab381..410a47fdc 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_with_yes.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_with_yes.snap@@ -11,7 +11,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -35,7 +35,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1myes-no-hooks[22m and worktree from [1mmain[22m @ [1m_REPO_.yes-no-hooks[22m[39m+[32m✓[39m [32mCreated branch [1myes-no-hooks[22m from [1mmain[22m and worktree @ [1m_REPO_.yes-no-hooks[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_post_hook_no_path_with_shell_integration.snap b/tests/snapshots/integration__integration_tests__switch__switch_post_hook_no_path_with_shell_integration.snapindex 5abbecd46..d1019022b 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_post_hook_no_path_with_shell_integration.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_post_hook_no_path_with_shell_integration.snap@@ -10,7 +10,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -35,7 +35,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mpost-hook-shell-test[22m and worktree from [1mmain[22m @ [1m_REPO_.post-hook-shell-test[22m[39m+[32m✓[39m [32mCreated branch [1mpost-hook-shell-test[22m from [1mmain[22m and worktree @ [1m_REPO_.post-hook-shell-test[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[36m◎[39m [36mRunning post-switch project hook:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m switcheddiff --git a/tests/snapshots/integration__integration_tests__switch__switch_post_hook_path_annotation.snap b/tests/snapshots/integration__integration_tests__switch__switch_post_hook_path_annotation.snapindex 51ad9f003..9b1627b0d 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_post_hook_path_annotation.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_post_hook_path_annotation.snap@@ -10,7 +10,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -34,7 +34,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mpost-hook-test[22m and worktree from [1mmain[22m @ [1m_REPO_.post-hook-test[22m[39m+[32m✓[39m [32mCreated branch [1mpost-hook-test[22m from [1mmain[22m and worktree @ [1m_REPO_.post-hook-test[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_primary_on_different_branch.snap b/tests/snapshots/integration__integration_tests__switch__switch_primary_on_different_branch.snapindex 8d5483156..841f7a889 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_primary_on_different_branch.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_primary_on_different_branch.snap@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -33,7 +33,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mfeature-from-main[22m and worktree from [1mmain[22m @ [1m_REPO_.feature-from-main[22m[39m+[32m✓[39m [32mCreated branch [1mfeature-from-main[22m from [1mmain[22m and worktree @ [1m_REPO_.feature-from-main[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_with_base.snap b/tests/snapshots/integration__integration_tests__switch__switch_with_base.snapindex f80c9e158..334627748 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_with_base.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_with_base.snap@@ -11,7 +11,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -35,7 +35,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mfeature-with-base[22m and worktree from [1mmain[22m @ [1m_REPO_.feature-with-base[22m[39m+[32m✓[39m [32mCreated branch [1mfeature-with-base[22m from [1mmain[22m and worktree @ [1m_REPO_.feature-with-base[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__user_hooks__no_verify_skips_all_hooks.snap b/tests/snapshots/integration__integration_tests__user_hooks__no_verify_skips_all_hooks.snapindex a1d7add45..3beb9bc6e 100644--- a/tests/snapshots/integration__integration_tests__user_hooks__no_verify_skips_all_hooks.snap+++ b/tests/snapshots/integration__integration_tests__user_hooks__no_verify_skips_all_hooks.snap@@ -10,7 +10,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -34,7 +34,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_and_project_post_start.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_and_project_post_start.snapindex 3f54532be..dab9367e7 100644--- a/tests/snapshots/integration__integration_tests__user_hooks__user_and_project_post_start.snap+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_and_project_post_start.snap@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -33,7 +33,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_hook_template_vars.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_hook_template_vars.snapindex 1b101d5c1..d114dda29 100644--- a/tests/snapshots/integration__integration_tests__user_hooks__user_hook_template_vars.snap+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_hook_template_vars.snap@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -35,7 +35,7 @@ exit_code: 0----- stderr -----[36m◎[39m [36mRunning post-create [1muser:vars[22m @ [1m_REPO_.feature[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'repo=repo branch=feature'[0m[2m [0m[2m[36m>[0m[2m template_vars.txt-[0m[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[0m[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_hooks_before_project.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_hooks_before_project.snapindex 17d604f5a..0633dc378 100644--- a/tests/snapshots/integration__integration_tests__user_hooks__user_hooks_before_project.snap+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_hooks_before_project.snap@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -37,7 +37,7 @@ exit_code: 0[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'USER_HOOK'[0m[2m [0m[2m[36m>>[0m[2m hook_order.txt[0m[36m◎[39m [36mRunning post-create project hook @ [1m_REPO_.feature[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'PROJECT_HOOK'[0m[2m [0m[2m[36m>>[0m[2m hook_order.txt-[0m[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[0m[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_hooks_no_approval.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_hooks_no_approval.snapindex 9a490faea..a0e77ce6a 100644--- a/tests/snapshots/integration__integration_tests__user_hooks__user_hooks_no_approval.snap+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_hooks_no_approval.snap@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -35,7 +35,7 @@ exit_code: 0----- stderr -----[36m◎[39m [36mRunning post-create [1muser:setup[22m @ [1m_REPO_.feature[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'NO_APPROVAL_NEEDED'[0m[2m [0m[2m[36m>[0m[2m no_approval.txt-[0m[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[0m[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_post_create_executes.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_post_create_executes.snapindex 75b998a1e..797e358eb 100644--- a/tests/snapshots/integration__integration_tests__user_hooks__user_post_create_executes.snap+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_post_create_executes.snap@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -35,7 +35,7 @@ exit_code: 0----- stderr -----[36m◎[39m [36mRunning post-create [1muser:log[22m @ [1m_REPO_.feature[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'USER_POST_CREATE_RAN'[0m[2m [0m[2m[36m>[0m[2m user_hook_marker.txt-[0m[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[0m[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_post_create_failure.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_post_create_failure.snapindex 0061737e9..c4e6b8bca 100644--- a/tests/snapshots/integration__integration_tests__user_hooks__user_post_create_failure.snap+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_post_create_failure.snap@@ -36,7 +36,7 @@ exit_code: 0[36m◎[39m [36mRunning post-create [1muser:failing[22m @ [1m_REPO_.feature[22m:[39m[107m [0m [2m[0m[2m[34mexit[0m[2m 1[0m[31m✗[39m [31mCommand [1mfailing[22m failed: exit status: 1[39m-[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_post_start_executes.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_post_start_executes.snapindex 024405bef..4906fbbb4 100644--- a/tests/snapshots/integration__integration_tests__user_hooks__user_post_start_executes.snap+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_post_start_executes.snap@@ -9,7 +9,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -33,7 +33,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_post_start_skipped_no_verify.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_post_start_skipped_no_verify.snapindex a1d7add45..3beb9bc6e 100644--- a/tests/snapshots/integration__integration_tests__user_hooks__user_post_start_skipped_no_verify.snap+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_post_start_skipped_no_verify.snap@@ -10,7 +10,7 @@ info:env:APPDATA: "[TEST_CONFIG_HOME]"CLICOLOR_FORCE: "1"- COLUMNS: "150"+ COLUMNS: "500"GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"@@ -34,7 +34,7 @@ exit_code: 0----- stdout ---------- stderr ------[32m✓[39m [32mCreated branch [1mfeature[22m and worktree from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[32m✓[39m [32mCreated branch [1mfeature[22m from [1mmain[22m and worktree @ [1m_REPO_.feature[22m[39m[2m↳[22m [2mCustomize worktree locations: [90mwt config create[39m[22m[33m▲[39m [33mCannot change directory — shell integration not installed[39m[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m