Skip to content

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

Add restart hint when shell integration is configured but not active (#330)

Maximilian Roos82010d0eb725
diff --git a/src/output/handlers.rs b/src/output/handlers.rs
index af3baa1c5..934642e35 100644
--- a/src/output/handlers.rs
+++ b/src/output/handlers.rs
@@ -355,7 +355,7 @@ pub fn handle_switch_output(
{
// Shell wrapper is configured but user ran binary directly
super::print(warning_message(cformat!(
- "Worktree for <bold>{branch}</> @ <bold>{path_display}</>, but cannot change directory — shell integration not active"
+ "Worktree for <bold>{branch}</> @ <bold>{path_display}</>, but cannot change directory — restart your shell to activate"
)))?;
if let Some(warning) = path_mismatch_warning {
super::print(warning)?;
diff --git a/tests/snapshots/integration__integration_tests__help__version.snap b/tests/snapshots/integration__integration_tests__help__version.snap
index 228e6df3f..c080d1a99 100644
--- a/tests/snapshots/integration__integration_tests__help__version.snap
+++ b/tests/snapshots/integration__integration_tests__help__version.snap
@@ -8,6 +8,8 @@ info:
CLICOLOR_FORCE: "1"
COLUMNS: "150"
GIT_EDITOR: ""
+ GIT_FETCH_ARGS: ""
+ RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
---
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_existing_with_shell_configured.snap b/tests/snapshots/integration__integration_tests__switch__switch_existing_with_shell_configured.snap
index d47f1d87e..252bab6db 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_existing_with_shell_configured.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_existing_with_shell_configured.snap
@@ -14,6 +14,7 @@ info:
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
GIT_CONFIG_SYSTEM: /dev/null
GIT_EDITOR: ""
+ GIT_FETCH_ARGS: ""
GIT_TERMINAL_PROMPT: "0"
HOME: "[TEST_HOME]"
LANG: C
@@ -30,4 +31,4 @@ exit_code: 0
----- stdout -----
----- stderr -----
-▲ Worktree for shell-configured @ _REPO_.shell-configured, but cannot change directory — shell integration not active
+▲ Worktree for shell-configured @ _REPO_.shell-configured, but cannot change directory — restart your shell to activate