Skip to content

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

fix: show expanded --execute command in gutter with path context (#708)

Maximilian Roos2ff5b4d63a04
diff --git a/src/commands/select/mod.rs b/src/commands/select/mod.rs
index caf2e55c8..f2e18b958 100644
--- a/src/commands/select/mod.rs
+++ b/src/commands/select/mod.rs
@@ -229,7 +229,7 @@ pub fn handle_select(
execute!(stderr(), crossterm::cursor::MoveTo(0, 0))?;
// Show success message; emit cd directive if shell integration is active
- handle_switch_output(&result, &branch_info, None)?;
+ handle_switch_output(&result, &branch_info)?;
}
Ok(())
diff --git a/src/main.rs b/src/main.rs
index 03e395aa3..52fe89451 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -766,8 +766,7 @@ fn main() {
// 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
// Also shows worktree-path hint on first --create (before shell integration warning)
- let hooks_display_path =
- handle_switch_output(&result, &branch_info, execute.as_deref())?;
+ let hooks_display_path = handle_switch_output(&result, &branch_info)?;
// Offer shell integration if not already installed/active
// (only shows prompt/hint when shell integration isn't working)
@@ -867,7 +866,7 @@ fn main() {
.collect();
format!("{} {}", expanded_cmd, escaped_args.join(" "))
};
- execute_user_command(&full_cmd)?;
+ execute_user_command(&full_cmd, hooks_display_path.as_deref())?;
}
Ok(())
diff --git a/src/output/handlers.rs b/src/output/handlers.rs
index 039e185e3..ba956940a 100644
--- a/src/output/handlers.rs
+++ b/src/output/handlers.rs
@@ -291,7 +291,6 @@ fn print_switch_message_if_changed(
pub fn handle_switch_output(
result: &SwitchResult,
branch_info: &SwitchBranchInfo,
- execute_command: Option<&str>,
) -> anyhow::Result<Option<std::path::PathBuf>> {
// Set target directory for command execution
super::change_directory(result.path())?;
@@ -339,18 +338,13 @@ pub fn handle_switch_output(
if let Some(warning) = branch_worktree_mismatch_warning {
super::print(warning)?;
}
- if let Some(cmd) = execute_command {
- // --execute: command runs in target dir, but shell stays put
- super::print(warning_message(cformat!(
- "Executing <bold>{cmd}</> @ <bold>{path_display}</>, but shell directory unchanged — {reason}"
- )))?;
- } else {
- // No --execute: what exists + why cd won't happen
- super::print(warning_message(cformat!(
- "Worktree for <bold>{branch}</> @ <bold>{path_display}</>, but cannot change directory — {reason}"
- )))?;
- }
+ // Show what exists + why cd won't happen
+ // (--execute command display is handled by execute_user_command)
+ super::print(warning_message(cformat!(
+ "Worktree for <bold>{branch}</> @ <bold>{path_display}</>, but cannot change directory — {reason}"
+ )))?;
// Show git subcommand hint if running as git wt
+ // (regular shell integration hint is shown by prompt_shell_integration in main.rs)
if is_git_subcommand {
super::print(hint_message(git_subcommand_warning()))?;
}
@@ -403,18 +397,14 @@ pub fn handle_switch_output(
}
// Warn if shell won't cd to the new worktree
+ // (--execute command display is handled by execute_user_command)
if let Some(reason) = shell_warning_reason {
- if let Some(cmd) = execute_command {
- super::print(warning_message(cformat!(
- "Executing <bold>{cmd}</> @ <bold>{path_display}</>, but shell directory unchanged — {reason}"
- )))?;
- } else {
- // Don't repeat "Created worktree" — success message above already said that
- super::print(warning_message(cformat!(
- "Cannot change directory — {reason}"
- )))?;
- }
+ // Don't repeat "Created worktree" — success message above already said that
+ super::print(warning_message(cformat!(
+ "Cannot change directory — {reason}"
+ )))?;
// Show git subcommand hint if running as git wt
+ // (regular shell integration hint is shown by prompt_shell_integration in main.rs)
if is_git_subcommand {
super::print(hint_message(git_subcommand_warning()))?;
}
@@ -434,11 +424,22 @@ pub fn handle_switch_output(
}
/// Execute the --execute command after hooks have run
-pub fn execute_user_command(command: &str) -> anyhow::Result<()> {
+///
+/// `display_path` is shown when the user's shell won't be in the worktree directory
+/// (shell integration not active). This helps users understand where the command runs.
+pub fn execute_user_command(command: &str, display_path: Option<&Path>) -> anyhow::Result<()> {
use worktrunk::styling::format_bash_with_gutter;
// Show what command is being executed (section header + gutter content)
- super::print(progress_message("Executing (--execute):"))?;
+ // Include path when user's shell won't be there (shell integration not active)
+ let header = match display_path {
+ Some(path) => {
+ let path_display = format_path_for_display(path);
+ cformat!("Executing (--execute) @ <bold>{path_display}</>:")
+ }
+ None => "Executing (--execute):".to_string(),
+ };
+ super::print(progress_message(header))?;
super::print(format_bash_with_gutter(command))?;
super::execute(command)?;
diff --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.snap
index 02eae0977..87835fc6c 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
@@ -16,6 +16,7 @@ info:
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
@@ -38,9 +39,9 @@ exit_code: 0
----- stderr -----
✓ Created branch feature from main and worktree @ _REPO_.feature
↳ To customize worktree locations, run wt config create
-▲ Executing echo 'Execute flag' > execute.txt @ _REPO_.feature, but shell directory unchanged — shell integration not installed
+▲ Cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
◎ Running post-start project hook @ _REPO_.feature:
  echo 'Background task' > background.txt
-◎ Executing (--execute):
+◎ Executing (--execute) @ _REPO_.feature:
  echo 'Execute flag' > execute.txt
diff --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.snap
index 526651c58..e1b705668 100644
--- 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.snap
@@ -19,6 +19,7 @@ info:
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
@@ -41,6 +42,6 @@ exit_code: 1
----- stderr -----
✓ Created branch arg-error-test from main and worktree @ _REPO_.arg-error-test
↳ To customize worktree locations, run wt config create
-▲ Executing echo @ _REPO_.arg-error-test, but shell directory unchanged — shell integration not installed
+▲ Cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
✗ Failed to expand argument template: Template syntax error: syntax error: unexpected end of input, expected end of variable block (in <string>:1)
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_creates_file.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_creates_file.snap
index d50104080..643bb0708 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
@@ -16,6 +16,7 @@ info:
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
@@ -38,7 +39,7 @@ exit_code: 0
----- stderr -----
✓ Created branch file-test from main and worktree @ _REPO_.file-test
↳ To customize worktree locations, run wt config create
-▲ Executing echo 'test content' > test.txt @ _REPO_.file-test, but shell directory unchanged — shell integration not installed
+▲ Cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
-◎ Executing (--execute):
+◎ Executing (--execute) @ _REPO_.file-test:
  echo 'test content' > test.txt
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_existing.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_existing.snap
index e157f09d1..ab197c780 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_existing.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_existing.snap
@@ -15,6 +15,7 @@ info:
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
@@ -35,7 +36,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-▲ Executing echo 'existing worktree' > existing.txt @ _REPO_.existing-exec, but shell directory unchanged — shell integration not installed
+▲ Worktree for existing-exec @ _REPO_.existing-exec, but cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
-◎ Executing (--execute):
+◎ Executing (--execute) @ _REPO_.existing-exec:
  echo 'existing worktree' > existing.txt
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_failure.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_failure.snap
index e905e4b44..2b507492f 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_failure.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_failure.snap
@@ -16,6 +16,7 @@ info:
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
@@ -38,7 +39,7 @@ exit_code: 1
----- stderr -----
✓ Created branch fail-test from main and worktree @ _REPO_.fail-test
↳ To customize worktree locations, run wt config create
-▲ Executing exit 1 @ _REPO_.fail-test, but shell directory unchanged — shell integration not installed
+▲ Cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
-◎ Executing (--execute):
+◎ Executing (--execute) @ _REPO_.fail-test:
  exit 1
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_multiline.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_multiline.snap
index 9af9c0149..78b165ac7 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_multiline.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_multiline.snap
@@ -16,6 +16,7 @@ info:
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
@@ -41,11 +42,9 @@ line3
----- stderr -----
✓ Created branch multiline-test from main and worktree @ _REPO_.multiline-test
↳ To customize worktree locations, run wt config create
-▲ Executing echo 'line1'
-echo 'line2'
-echo 'line3' @ _REPO_.multiline-test, but shell directory unchanged — shell integration not installed
+▲ Cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
-◎ Executing (--execute):
+◎ Executing (--execute) @ _REPO_.multiline-test:
  echo 'line1'
  echo 'line2'
  echo 'line3'
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_success.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_success.snap
index 252db0340..634c5a92f 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_success.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_success.snap
@@ -16,6 +16,7 @@ info:
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
@@ -39,7 +40,7 @@ test output
----- stderr -----
✓ Created branch exec-test from main and worktree @ _REPO_.exec-test
↳ To customize worktree locations, run wt config create
-▲ Executing echo 'test output' @ _REPO_.exec-test, but shell directory unchanged — shell integration not installed
+▲ Cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
-◎ Executing (--execute):
+◎ Executing (--execute) @ _REPO_.exec-test:
  echo 'test output'
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_template_base.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_template_base.snap
index d5a42439e..69327927a 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
@@ -18,6 +18,7 @@ info:
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
@@ -41,7 +42,7 @@ base=main
----- stderr -----
✓ Created branch from-main from main and worktree @ _REPO_.from-main
↳ To customize worktree locations, run wt config create
-▲ Executing echo 'base={{ base }}' @ _REPO_.from-main, but shell directory unchanged — shell integration not installed
+▲ Cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
-◎ Executing (--execute):
+◎ Executing (--execute) @ _REPO_.from-main:
  echo 'base=main'
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_template_base_without_create.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_template_base_without_create.snap
index 9cf244b1a..863dffcf0 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_template_base_without_create.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_template_base_without_create.snap
@@ -15,6 +15,7 @@ info:
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
@@ -36,7 +37,7 @@ exit_code: 0
base=
----- stderr -----
-▲ Executing echo 'base={{ base }}' @ _REPO_.existing, but shell directory unchanged — shell integration not installed
+▲ Worktree for existing @ _REPO_.existing, but cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
-◎ Executing (--execute):
+◎ Executing (--execute) @ _REPO_.existing:
  echo 'base='
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_template_branch.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_template_branch.snap
index fa0566c90..f1c3a12fa 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
@@ -16,6 +16,7 @@ info:
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
@@ -39,7 +40,7 @@ branch=template-test
----- stderr -----
✓ Created branch template-test from main and worktree @ _REPO_.template-test
↳ To customize worktree locations, run wt config create
-▲ Executing echo 'branch={{ branch }}' @ _REPO_.template-test, but shell directory unchanged — shell integration not installed
+▲ Cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
-◎ Executing (--execute):
+◎ Executing (--execute) @ _REPO_.template-test:
  echo 'branch=template-test'
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_template_error.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_template_error.snap
index 95900b535..e5d7097c6 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_template_error.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_template_error.snap
@@ -16,6 +16,7 @@ info:
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
@@ -38,6 +39,6 @@ exit_code: 1
----- stderr -----
✓ Created branch error-test from main and worktree @ _REPO_.error-test
↳ To customize worktree locations, run wt config create
-▲ Executing echo {{ unclosed @ _REPO_.error-test, but shell directory unchanged — shell integration not installed
+▲ Cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
✗ Failed to expand --execute template: Template syntax error: syntax error: unexpected end of input, expected end of variable block (in <string>:1)
diff --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.snap
index c4847d612..455dc1928 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
@@ -19,6 +19,7 @@ info:
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
@@ -42,7 +43,7 @@ branch=args-test repo=repo
----- stderr -----
✓ Created branch args-test from main and worktree @ _REPO_.args-test
↳ To customize worktree locations, run wt config create
-▲ Executing echo @ _REPO_.args-test, but shell directory unchanged — shell integration not installed
+▲ Cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
-◎ Executing (--execute):
+◎ Executing (--execute) @ _REPO_.args-test:
  echo 'branch=args-test' 'repo=repo'
diff --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.snap
index fcfec6f4b..f0e71f274 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
@@ -16,6 +16,7 @@ info:
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
@@ -39,7 +40,7 @@ feat;id
----- stderr -----
✓ Created branch feat;id from main and worktree @ _REPO_.feat;id
↳ To customize worktree locations, run wt config create
-▲ Executing echo {{ branch }} @ _REPO_.feat;id, but shell directory unchanged — shell integration not installed
+▲ Cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
-◎ Executing (--execute):
+◎ Executing (--execute) @ _REPO_.feat;id:
  echo 'feat;id'
diff --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.snap
index 920266a42..45b35b124 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
@@ -16,6 +16,7 @@ info:
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
@@ -39,7 +40,7 @@ sanitized=feature-with-slash
----- stderr -----
✓ Created branch feature/with-slash from main and worktree @ _REPO_.feature-with-slash
↳ To customize worktree locations, run wt config create
-▲ Executing echo 'sanitized={{ branch | sanitize }}' @ _REPO_.feature-with-slash, but shell directory unchanged — shell integration not installed
+▲ Cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
-◎ Executing (--execute):
+◎ Executing (--execute) @ _REPO_.feature-with-slash:
  echo 'sanitized=feature-with-slash'
diff --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.snap
index 796d39eae..19fae87d3 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
@@ -16,6 +16,7 @@ info:
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
@@ -39,7 +40,7 @@ path=_REPO_.path-test
----- stderr -----
✓ Created branch path-test from main and worktree @ _REPO_.path-test
↳ To customize worktree locations, run wt config create
-▲ Executing echo 'path={{ worktree_path }}' @ _REPO_.path-test, but shell directory unchanged — shell integration not installed
+▲ Cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
-◎ Executing (--execute):
+◎ Executing (--execute) @ _REPO_.path-test:
  echo 'path=_REPO_.path-test'
diff --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.snap
index bac79a345..767324af3 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
@@ -17,6 +17,7 @@ info:
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
@@ -40,7 +41,7 @@ execute command runs
----- stderr -----
✓ Created branch no-hooks-test from main and worktree @ _REPO_.no-hooks-test
↳ To customize worktree locations, run wt config create
-▲ Executing echo 'execute command runs' @ _REPO_.no-hooks-test, but shell directory unchanged — shell integration not installed
+▲ Cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
-◎ Executing (--execute):
+◎ Executing (--execute) @ _REPO_.no-hooks-test:
  echo 'execute command runs'
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_existing.snap b/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_existing.snap
index 4a133a861..7abef0d1b 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_existing.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_existing.snap
@@ -16,6 +16,7 @@ info:
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
@@ -37,7 +38,7 @@ exit_code: 0
execute still runs
----- stderr -----
-▲ Executing echo 'execute still runs' @ _REPO_.existing-no-hooks, but shell directory unchanged — shell integration not installed
+▲ Worktree for existing-no-hooks @ _REPO_.existing-no-hooks, but cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install
-◎ Executing (--execute):
+◎ Executing (--execute) @ _REPO_.existing-no-hooks:
  echo 'execute still runs'