Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
Add shell integration prompt after wt switch (#370)
Maximilian Roosd21a463430a0
diff --git a/src/commands/configure_shell.rs b/src/commands/configure_shell.rsindex 01df108d5..fa7bcdc18 100644--- a/src/commands/configure_shell.rs+++ b/src/commands/configure_shell.rs@@ -148,7 +148,12 @@ pub fn handle_configure_shell(// Show what will be done and ask for confirmation (unless --yes flag is used)if !skip_confirmation- && !prompt_for_confirmation(&preview.configured, &completion_preview, &cmd)?+ && !prompt_for_install(+ &preview.configured,+ &completion_preview,+ &cmd,+ "Install shell integration?",+ )?{return Err("Cancelled by user".to_string());}@@ -492,17 +497,20 @@ fn configure_fish_file(}))}-fn prompt_for_confirmation(+/// Display what will be installed (shell extensions and completions)+///+/// Shows the config lines that will be added without prompting.+/// Used both for install preview and when user types `?` at prompt.+///+/// Note: I/O errors are intentionally ignored - preview is best-effort+/// and shouldn't block the prompt flow.+pub fn show_install_preview(results: &[ConfigureResult],completion_results: &[CompletionResult],cmd: &str,-) -> Result<bool, String> {+) {use anstyle::Style;- // CRITICAL: Flush stdout before writing to stderr to prevent stream interleaving- // Flushes both stdout (for data output) and stderr (for messages)- crate::output::flush().map_err(|e| e.to_string())?;-let bold = Style::new().bold();// Show shell extension changes@@ -521,16 +529,15 @@ fn prompt_for_confirmation("shell extension & completions"};- output::print(format!(+ let _ = output::print(format!("{} {} {what} for {bold}{shell}{bold:#} @ {bold}{path}{bold:#}",result.action.symbol(),result.action.description(),- ))- .map_err(|e| e.to_string())?;+ ));// Show the config line that will be added with gutter- output::print(format_bash_with_gutter(&result.config_line)).map_err(|e| e.to_string())?;- output::blank().map_err(|e| e.to_string())?; // Blank line after each shell block+ let _ = output::print(format_bash_with_gutter(&result.config_line));+ let _ = output::blank(); // Blank line after each shell block}// Show completion changes (only fish has separate completion files)@@ -542,28 +549,72 @@ fn prompt_for_confirmation(let shell = result.shell;let path = format_path_for_display(&result.path);- output::print(format!(+ let _ = output::print(format!("{} {} completions for {bold}{shell}{bold:#} @ {bold}{path}{bold:#}",result.action.symbol(),result.action.description(),- ))- .map_err(|e| e.to_string())?;+ ));// Show the completion content that will be writtenlet fish_completion = fish_completion_content(cmd);- output::print(format_bash_with_gutter(fish_completion.trim()))- .map_err(|e| e.to_string())?;- output::blank().map_err(|e| e.to_string())?; // Blank line after+ let _ = output::print(format_bash_with_gutter(fish_completion.trim()));+ let _ = output::blank(); // Blank line after}+}- prompt_yes_no()+/// Prompt for install with [y/N/?] options+///+/// - `y` or `yes`: Accept and return true+/// - `n`, `no`, or empty: Decline and return false+/// - `?`: Show preview (via show_install_preview) and re-prompt+pub fn prompt_for_install(+ results: &[ConfigureResult],+ completion_results: &[CompletionResult],+ cmd: &str,+ prompt_text: &str,+) -> Result<bool, String> {+ use std::io::Write;++ // Flush before interactive prompt+ crate::output::flush().map_err(|e| e.to_string())?;++ loop {+ eprint!(+ "{}",+ color_print::cformat!("{} {} <bold>[y/N/?]</> ", PROMPT_SYMBOL, prompt_text)+ );+ io::stderr().flush().map_err(|e| e.to_string())?;++ let mut input = String::new();+ io::stdin()+ .read_line(&mut input)+ .map_err(|e| e.to_string())?;++ let response = input.trim().to_lowercase();+ match response.as_str() {+ "y" | "yes" => {+ eprintln!();+ return Ok(true);+ }+ "?" => {+ eprintln!();+ show_install_preview(results, completion_results, cmd);+ // Loop back to prompt again+ }+ _ => {+ // Empty, "n", "no", or anything else is decline+ eprintln!();+ return Ok(false);+ }+ }+ }}-/// Prompt user for yes/no confirmation, returns true if user confirms+/// Prompt user for yes/no confirmation (simple [y/N] prompt)fn prompt_yes_no() -> Result<bool, String> {use anstyle::Style;use std::io::Write;- use worktrunk::styling::{PROMPT_SYMBOL, eprint};+ use worktrunk::styling::eprint;let bold = Style::new().bold();eprint!("{PROMPT_SYMBOL} Proceed? {bold}[y/N]{bold:#} ");diff --git a/src/commands/mod.rs b/src/commands/mod.rsindex aeb65d374..7039a3f57 100644--- a/src/commands/mod.rs+++ b/src/commands/mod.rs@@ -23,9 +23,7 @@ pub use config::{handle_config_create, handle_config_show, handle_state_clear, handle_state_clear_all,handle_state_get, handle_state_set, handle_state_show,};-pub use configure_shell::{- ConfigAction, handle_configure_shell, handle_show_theme, handle_unconfigure_shell,-};+pub use configure_shell::{handle_configure_shell, handle_show_theme, handle_unconfigure_shell};pub use for_each::step_for_each;pub use init::handle_init;pub use list::handle_list;diff --git a/src/commands/standalone.rs b/src/commands/standalone.rsindex 7d28f3160..3f44c2fd5 100644--- a/src/commands/standalone.rs+++ b/src/commands/standalone.rs@@ -661,7 +661,7 @@ pub fn clear_approvals(global: bool) -> anyhow::Result<()> {.unwrap_or(0);config- .revoke_project(project_id)+ .revoke_project(project_id, None).context("Failed to clear project approvals")?;crate::output::print(success_message(format!(diff --git a/src/config/mod.rs b/src/config/mod.rsindex c3879785e..936673794 100644--- a/src/config/mod.rs+++ b/src/config/mod.rs@@ -366,7 +366,7 @@ task2 = "echo 'Task 2 running' > task2.txt"// First approvalassert!(!config.is_command_approved("github.com/user/repo", "npm install"));config- .approve_command_to(+ .approve_command("github.com/user/repo".to_string(),"npm install".to_string(),Some(&config_path),@@ -382,7 +382,7 @@ task2 = "echo 'Task 2 running' > task2.txt".approved_commands.len();config- .approve_command_to(+ .approve_command("github.com/user/repo".to_string(),"npm install".to_string(),Some(&config_path),@@ -410,14 +410,14 @@ task2 = "echo 'Task 2 running' > task2.txt"// Set up two approved commandsconfig- .approve_command_to(+ .approve_command("github.com/user/repo".to_string(),"npm install".to_string(),Some(&config_path),).unwrap();config- .approve_command_to(+ .approve_command("github.com/user/repo".to_string(),"npm test".to_string(),Some(&config_path),@@ -429,7 +429,7 @@ task2 = "echo 'Task 2 running' > task2.txt"// Revoke one commandconfig- .revoke_command_to("github.com/user/repo", "npm install", Some(&config_path))+ .revoke_command("github.com/user/repo", "npm install", Some(&config_path)).unwrap();assert!(!config.is_command_approved("github.com/user/repo", "npm install"));assert!(config.is_command_approved("github.com/user/repo", "npm test"));@@ -439,7 +439,7 @@ task2 = "echo 'Task 2 running' > task2.txt"// Revoke the last command - should remove the project entryconfig- .revoke_command_to("github.com/user/repo", "npm test", Some(&config_path))+ .revoke_command("github.com/user/repo", "npm test", Some(&config_path)).unwrap();assert!(!config.is_command_approved("github.com/user/repo", "npm test"));assert!(!config.projects.contains_key("github.com/user/repo"));@@ -456,12 +456,12 @@ task2 = "echo 'Task 2 running' > task2.txt"// Revoking from non-existent project is a no-opconfig- .revoke_command_to("github.com/user/repo", "npm install", Some(&config_path))+ .revoke_command("github.com/user/repo", "npm install", Some(&config_path)).unwrap();// Set up one commandconfig- .approve_command_to(+ .approve_command("github.com/user/repo".to_string(),"npm install".to_string(),Some(&config_path),@@ -470,7 +470,7 @@ task2 = "echo 'Task 2 running' > task2.txt"// Revoking non-existent command is a no-opconfig- .revoke_command_to("github.com/user/repo", "npm test", Some(&config_path))+ .revoke_command("github.com/user/repo", "npm test", Some(&config_path)).unwrap();assert!(config.is_command_approved("github.com/user/repo", "npm install"));}@@ -486,21 +486,21 @@ task2 = "echo 'Task 2 running' > task2.txt"// Set up multiple projectsconfig- .approve_command_to(+ .approve_command("github.com/user/repo1".to_string(),"npm install".to_string(),Some(&config_path),).unwrap();config- .approve_command_to(+ .approve_command("github.com/user/repo1".to_string(),"npm test".to_string(),Some(&config_path),).unwrap();config- .approve_command_to(+ .approve_command("github.com/user/repo2".to_string(),"cargo build".to_string(),Some(&config_path),@@ -512,17 +512,17 @@ task2 = "echo 'Task 2 running' > task2.txt"// Revoke entire projectconfig- .revoke_project_to("github.com/user/repo1", Some(&config_path))+ .revoke_project("github.com/user/repo1", Some(&config_path)).unwrap();assert!(!config.projects.contains_key("github.com/user/repo1"));assert!(config.projects.contains_key("github.com/user/repo2"));// Revoking non-existent project is a no-opconfig- .revoke_project_to("github.com/user/repo1", Some(&config_path))+ .revoke_project("github.com/user/repo1", Some(&config_path)).unwrap();config- .revoke_project_to("github.com/nonexistent/repo", Some(&config_path))+ .revoke_project("github.com/nonexistent/repo", Some(&config_path)).unwrap();}diff --git a/src/config/user.rs b/src/config/user.rsindex 544f61306..94167c74f 100644--- a/src/config/user.rs+++ b/src/config/user.rs@@ -155,6 +155,14 @@ pub struct WorktrunkConfig {#[serde(flatten, default)]pub hooks: HooksConfig,+ /// Skip the first-run shell integration prompt+ #[serde(+ default,+ rename = "skip-shell-integration-prompt",+ skip_serializing_if = "std::ops::Not::not"+ )]+ pub skip_shell_integration_prompt: bool,+/// Captures unknown fields for validation warnings#[serde(flatten, default, skip_serializing)]pub(crate) unknown: std::collections::HashMap<String, toml::Value>,@@ -300,6 +308,7 @@ impl Default for WorktrunkConfig {commit: None,merge: None,hooks: HooksConfig::default(),+ skip_shell_integration_prompt: false,unknown: std::collections::HashMap::new(),}}@@ -406,15 +415,11 @@ impl WorktrunkConfig {.unwrap_or(false)}- /// Add an approved command and save to config file- pub fn approve_command(&mut self, project: String, command: String) -> Result<(), ConfigError> {- self.approve_command_to(project, command, None)- }-- /// Add an approved command and save to a specific config file (for testing)+ /// Add an approved command and save to config file.////// Reloads from disk before modifying to reduce race conditions from concurrent processes.- pub fn approve_command_to(+ /// Pass `None` for default config path, or `Some(path)` for testing.+ pub fn approve_command(&mut self,project: String,command: String,@@ -480,16 +485,11 @@ impl WorktrunkConfig {Ok(())}- /// Revoke an approved command and save to config file- pub fn revoke_command(&mut self, project: &str, command: &str) -> Result<(), ConfigError> {- self.revoke_command_to(project, command, None)- }-- /// Revoke an approved command and save to a specific config file (for testing)+ /// Revoke an approved command and save to config file.////// Reloads from disk before modifying to reduce race conditions from concurrent processes.- #[doc(hidden)]- pub fn revoke_command_to(+ /// Pass `None` for default config path, or `Some(path)` for testing.+ pub fn revoke_command(&mut self,project: &str,command: &str,@@ -514,16 +514,11 @@ impl WorktrunkConfig {Ok(())}- /// Remove all approvals for a project and save to config file- pub fn revoke_project(&mut self, project: &str) -> Result<(), ConfigError> {- self.revoke_project_to(project, None)- }-- /// Remove all approvals for a project and save to a specific config file (for testing)+ /// Remove all approvals for a project and save to config file.////// Reloads from disk before modifying to reduce race conditions from concurrent processes.- #[doc(hidden)]- pub fn revoke_project_to(+ /// Pass `None` for default config path, or `Some(path)` for testing.+ pub fn revoke_project(&mut self,project: &str,config_path: Option<&std::path::Path>,@@ -537,6 +532,22 @@ impl WorktrunkConfig {Ok(())}+ /// Set `skip-shell-integration-prompt = true` and save.+ ///+ /// Pass `None` for default config path, or `Some(path)` for testing.+ pub fn set_skip_shell_integration_prompt(+ &mut self,+ config_path: Option<&std::path::Path>,+ ) -> Result<(), ConfigError> {+ if self.skip_shell_integration_prompt {+ return Ok(());+ }+ // Reload from disk first to avoid clobbering concurrent changes+ self.reload_projects_from(config_path)?;+ self.skip_shell_integration_prompt = true;+ self.save_impl(config_path)+ }+/// Save the current configuration to the default config file locationpub fn save(&self) -> Result<(), ConfigError> {self.save_impl(None)@@ -592,7 +603,14 @@ impl WorktrunkConfig {.parse().map_err(|e| ConfigError::Message(format!("Failed to parse config file: {}", e)))?;- // Only update the projects section - that's the only thing we modify programmatically+ // Update skip-shell-integration-prompt flag+ if self.skip_shell_integration_prompt {+ doc["skip-shell-integration-prompt"] = toml_edit::value(true);+ } else {+ doc.remove("skip-shell-integration-prompt");+ }++ // Update the projects section// Ensure projects table existsif !doc.contains_key("projects") {doc["projects"] = toml_edit::Item::Table(toml_edit::Table::new());@@ -626,6 +644,11 @@ impl WorktrunkConfig {let mut doc = toml_edit::DocumentMut::new();doc["worktree-path"] = toml_edit::value(&self.worktree_path);+ // skip-shell-integration-prompt (only if true)+ if self.skip_shell_integration_prompt {+ doc["skip-shell-integration-prompt"] = toml_edit::value(true);+ }+// commit-generation sectiondoc["commit-generation"] = toml_edit::Item::Table(toml_edit::Table::new());let commit_args: toml_edit::Array = self.commit_generation.args.iter().collect();@@ -866,6 +889,7 @@ rename-tab = "echo 'switched'"assert!(config.commit.is_none());assert!(config.merge.is_none());assert!(!config.commit_generation.is_configured());+ assert!(!config.skip_shell_integration_prompt);}#[test]@@ -949,4 +973,52 @@ rename-tab = "echo 'switched'"assert_eq!(parsed.squash, Some(true));assert_eq!(parsed.rebase, Some(false));}++ #[test]+ fn test_skip_shell_integration_prompt_default_false() {+ let config = WorktrunkConfig::default();+ assert!(!config.skip_shell_integration_prompt);+ }++ #[test]+ fn test_skip_shell_integration_prompt_serde_roundtrip() {+ // Test serialization when true+ let config = WorktrunkConfig {+ skip_shell_integration_prompt: true,+ ..WorktrunkConfig::default()+ };+ let toml = toml::to_string(&config).unwrap();+ assert!(toml.contains("skip-shell-integration-prompt = true"));++ // Test deserialization+ let parsed: WorktrunkConfig = toml::from_str(&toml).unwrap();+ assert!(parsed.skip_shell_integration_prompt);+ }++ #[test]+ fn test_skip_shell_integration_prompt_skipped_when_false() {+ // When false, the field should not appear in serialized output+ let config = WorktrunkConfig::default();+ let toml = toml::to_string(&config).unwrap();+ assert!(!toml.contains("skip-shell-integration-prompt"));+ }++ #[test]+ fn test_skip_shell_integration_prompt_parsed_from_toml() {+ let content = r#"+worktree-path = "../{{ main_worktree }}.{{ branch }}"+skip-shell-integration-prompt = true+"#;+ let config: WorktrunkConfig = toml::from_str(content).unwrap();+ assert!(config.skip_shell_integration_prompt);+ }++ #[test]+ fn test_skip_shell_integration_prompt_defaults_when_missing() {+ let content = r#"+worktree-path = "../{{ main_worktree }}.{{ branch }}"+"#;+ let config: WorktrunkConfig = toml::from_str(content).unwrap();+ assert!(!config.skip_shell_integration_prompt);+ }}diff --git a/src/main.rs b/src/main.rsindex 4f2849a1d..7d78219c3 100644--- a/src/main.rs+++ b/src/main.rs@@ -27,13 +27,13 @@ use commands::command_executor::CommandContext;use commands::handle_select;use commands::worktree::{SwitchResult, handle_push};use commands::{- ConfigAction, MergeOptions, RebaseResult, ResolutionContext, SquashResult, add_approvals,- approve_hooks, clear_approvals, compute_worktree_path, handle_config_create,- handle_config_show, handle_configure_shell, handle_hook_show, handle_init, handle_list,- handle_merge, handle_rebase, handle_remove, handle_remove_by_path, 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,- resolve_worktree_arg, run_hook, step_commit, step_for_each,+ MergeOptions, RebaseResult, ResolutionContext, SquashResult, add_approvals, approve_hooks,+ clear_approvals, compute_worktree_path, handle_config_create, handle_config_show,+ handle_configure_shell, handle_hook_show, handle_init, handle_list, handle_merge,+ handle_rebase, handle_remove, handle_remove_by_path, 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, resolve_worktree_arg, run_hook,+ step_commit, step_for_each,};use output::{execute_user_command, handle_remove_output, handle_switch_output};@@ -726,159 +726,19 @@ fn main() {// Auto-write to shell config files and completionslet cmd = cmd.unwrap_or_else(binary_name);handle_configure_shell(shell, yes, cmd)- .map_err(|e| anyhow::anyhow!("{}", e))- .and_then(|scan_result| {-- // Count shells that became (more) configured- // A shell counts if any of its components changed (extension or completions)- let shells_configured_count = scan_result- .configured- .iter()- .filter(|ext_result| {- let ext_changed =- !matches!(ext_result.action, ConfigAction::AlreadyExists);- let comp_changed = scan_result- .completion_results- .iter()- .find(|c| c.shell == ext_result.shell)- .is_some_and(|c| {- !matches!(c.action, ConfigAction::AlreadyExists)- });- ext_changed || comp_changed- })- .count();-- // Show configured shells grouped with their completions- for result in &scan_result.configured {- let shell = result.shell;- let path = format_path_for_display(&result.path);- // For bash/zsh, completions are inline in the init script- let what = if matches!(shell, worktrunk::shell::Shell::Bash | worktrunk::shell::Shell::Zsh) {- "shell extension & completions"- } else {- "shell extension"- };- let message = cformat!(- "{} {what} for <bold>{shell}</> @ <bold>{path}</>",- result.action.description()- );-- // Use appropriate output function based on action- // Note: WouldAdd/WouldCreate are only returned in preview mode,- // which is handled internally by prompt_for_confirmation()- match result.action {- ConfigAction::Added | ConfigAction::Created => {- crate::output::print(success_message(message))?;- }- ConfigAction::AlreadyExists => {- crate::output::print(info_message(message))?;- }- ConfigAction::WouldAdd | ConfigAction::WouldCreate => {- unreachable!("Preview actions handled by confirmation prompt")- }- }-- // Show completion result for this shell- // TODO: Inconsistent that shell extensions show gutter but completions don't.- // Completions are dynamic stubs (~30 lines) that call back to `wt` - not- // as meaningful to show, but the asymmetry is confusing.- if let Some(comp_result) = scan_result.completion_results.iter().find(|r| r.shell == shell) {- let comp_path = format_path_for_display(&comp_result.path);- let comp_message = cformat!(- "{} completions for <bold>{shell}</> @ <bold>{comp_path}</>",- comp_result.action.description()- );- match comp_result.action {- ConfigAction::Added | ConfigAction::Created => {- crate::output::print(success_message(comp_message))?;- }- ConfigAction::AlreadyExists => {- crate::output::print(info_message(comp_message))?;- }- ConfigAction::WouldAdd | ConfigAction::WouldCreate => {- unreachable!("Preview actions handled by confirmation prompt")- }- }- }- }-- // Show skipped shells- for (shell, path) in &scan_result.skipped {- let path = format_path_for_display(path);- crate::output::print(hint_message(cformat!(- "Skipped <bright-black>{shell}</>; {path} not found"- )))?;- }-- // Exit with error if no shells configured- if scan_result.configured.is_empty() {- return Err(worktrunk::git::GitError::Other {- message: "No shell config files found".into(),- }- .into());- }-- // Summary- if shells_configured_count > 0 {- crate::output::blank()?;- let plural = if shells_configured_count == 1 { "" } else { "s" };- crate::output::print(success_message(format!(- "Configured {shells_configured_count} shell{plural}"- )))?;- } else {- // No action: all shells were already configured- crate::output::print(success_message("All shells already configured"))?;- }-- // Zsh compinit advisory: shown after success, before restart hint- if scan_result.zsh_needs_compinit {- crate::output::print(warning_message(- "Completions require compinit; add to ~/.zshrc before the wt line:",- ))?;- crate::output::print(- worktrunk::styling::format_bash_with_gutter(- "autoload -Uz compinit && compinit",- ),- )?;- }-- // Restart hint: only shown if the current shell's extension changed- // Fish completions are lazily loaded from ~/.config/fish/completions/- // so no restart needed. Bash/Zsh completions are inline in the init script.- if shells_configured_count > 0 {- let current_shell = std::env::var("SHELL")- .ok()- .and_then(|s| s.rsplit('/').next().map(String::from));-- // Find if current shell had its extension changed- let current_shell_result =- current_shell.as_ref().and_then(|shell_name| {- scan_result- .configured- .iter()- .filter(|r| {- !matches!(r.action, ConfigAction::AlreadyExists)- })- .find(|r| {- r.shell.to_string().eq_ignore_ascii_case(shell_name)- })- });-- if let Some(result) = current_shell_result {- // Fish auto-sources from conf.d, so just say "Restart shell"- // Bash/Zsh can source directly for immediate activation- if matches!(result.shell, worktrunk::shell::Shell::Fish) {- crate::output::print(hint_message("Restart shell to activate"))?;- } else {- let path = format_path_for_display(&result.path);- crate::output::print(hint_message(format!(- "Restart shell or run: source {path}"- )))?;+ .map_err(|e| anyhow::anyhow!("{}", e))+ .and_then(|scan_result| {+ // Exit with error if no shells configured+ // Show skipped shells first so user knows what was tried+ if scan_result.configured.is_empty() {+ crate::output::print_skipped_shells(&scan_result.skipped)?;+ return Err(worktrunk::git::GitError::Other {+ message: "No shell config files found".into(),}+ .into());}- }- Ok(())- })+ crate::output::print_shell_install_result(&scan_result)+ })}ConfigShellCommand::Uninstall { shell, yes } => {let explicit_shell = shell.is_some();@@ -1253,7 +1113,7 @@ fn main() {verify,} => WorktrunkConfig::load().context("Failed to load config")- .and_then(|config| {+ .and_then(|mut 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 operation@@ -1314,6 +1174,16 @@ fn main() {// Show success message (temporal locality: immediately after worktree operation)handle_switch_output(&result, &branch_info, execute.is_some())?;+ // Offer shell integration if not already installed/active+ // (only shows prompt/hint when shell integration isn't working)+ // With --execute: show hints only (don't interrupt with prompt)+ // Best-effort: don't fail switch if offer fails+ if !output::is_shell_integration_active() {+ let skip_prompt = execute.is_some();+ let _ =+ output::prompt_shell_integration(&mut config, &binary_name(), skip_prompt);+ }+// Spawn background hooks after success message// - post-switch: runs on ALL switches (Created, Existing, AlreadyAt)// - post-start: runs only when creating a NEW worktreediff --git a/src/output/global.rs b/src/output/global.rsindex c4a792c93..c00cf1ee5 100644--- a/src/output/global.rs+++ b/src/output/global.rs@@ -36,7 +36,7 @@ use std::sync::{Mutex, OnceLock};use worktrunk::shell_exec::DIRECTIVE_FILE_ENV_VAR;#[cfg(unix)]use worktrunk::shell_exec::ShellConfig;-use worktrunk::styling::{eprintln, hint_message, stderr};+use worktrunk::styling::{eprintln, stderr};/// Global output state, lazily initialized on first access.///@@ -85,19 +85,6 @@ fn has_directive_file() -> bool {.is_some()}-/// Display a shell integration hint-///-/// Shell integration hints like "Run `wt config shell install` to enable automatic cd" are only-/// shown when shell integration is NOT active. When it is active, users already have it.-/// This is the canonical check - call sites don't need to guard.-pub fn shell_integration_hint(message: impl Into<String>) -> io::Result<()> {- if has_directive_file() {- return Ok(());- }- eprintln!("{}", hint_message(message.into()));- stderr().flush()-}-/// Print a message to stderr (written as-is)////// Use with message formatting functions for semantic output:diff --git a/src/output/handlers.rs b/src/output/handlers.rsindex 4ac3c05ef..a124587ce 100644--- a/src/output/handlers.rs+++ b/src/output/handlers.rs@@ -287,7 +287,293 @@ fn get_flag_note(/// Shell integration hint messagefn shell_integration_hint() -> String {- cformat!("Run <bright-black>wt config shell install</> to enable automatic cd")+ cformat!("To enable automatic cd, run <bright-black>wt config shell install</>")+}++/// Shell integration hint for unknown/unsupported shell+fn shell_integration_unsupported_shell(shell_path: &str) -> String {+ // Extract shell name from path (e.g., "/bin/tcsh" -> "tcsh")+ let shell_name = shell_path.rsplit('/').next().unwrap_or(shell_path);+ format!(+ "Shell integration not yet supported for {shell_name} (supports bash, zsh, fish, PowerShell)"+ )+}++/// Print skipped shells (config file not found)+pub fn print_skipped_shells(+ skipped: &[(worktrunk::shell::Shell, std::path::PathBuf)],+) -> anyhow::Result<()> {+ for (shell, path) in skipped {+ let path = format_path_for_display(path);+ super::print(hint_message(cformat!(+ "Skipped <bright-black>{shell}</>; <bright-black>{path}</> not found"+ )))?;+ }+ Ok(())+}++/// Print the result of shell integration installation.+///+/// Shows:+/// - Configured shells with their paths+/// - Completion results (for fish)+/// - Skipped shells+/// - Summary count+/// - Zsh compinit warning if needed+/// - Restart hint for current shell+///+/// Used by both `wt config shell install` and the interactive prompt after `wt switch`.+pub fn print_shell_install_result(+ scan_result: &crate::commands::configure_shell::ScanResult,+) -> anyhow::Result<()> {+ use crate::commands::configure_shell::ConfigAction;+ use worktrunk::styling::format_bash_with_gutter;++ // Count shells that became (more) configured+ let shells_configured_count = scan_result+ .configured+ .iter()+ .filter(|ext_result| {+ let ext_changed = !matches!(ext_result.action, ConfigAction::AlreadyExists);+ let comp_changed = scan_result+ .completion_results+ .iter()+ .find(|c| c.shell == ext_result.shell)+ .is_some_and(|c| !matches!(c.action, ConfigAction::AlreadyExists));+ ext_changed || comp_changed+ })+ .count();++ // Show configured shells grouped with their completions+ for result in &scan_result.configured {+ let shell = result.shell;+ let path = format_path_for_display(&result.path);+ // For bash/zsh, completions are inline in the init script+ let what = if matches!(shell, Shell::Bash | Shell::Zsh) {+ "shell extension & completions"+ } else {+ "shell extension"+ };+ let message = cformat!(+ "{} {what} for <bold>{shell}</> @ <bold>{path}</>",+ result.action.description()+ );++ match result.action {+ ConfigAction::Added | ConfigAction::Created => {+ super::print(success_message(message))?;+ }+ ConfigAction::AlreadyExists => {+ super::print(info_message(message))?;+ }+ ConfigAction::WouldAdd | ConfigAction::WouldCreate => {+ unreachable!("Preview actions handled by confirmation prompt")+ }+ }++ // Show completion result for this shell (fish has separate completion files)+ if let Some(comp_result) = scan_result+ .completion_results+ .iter()+ .find(|r| r.shell == shell)+ {+ let comp_path = format_path_for_display(&comp_result.path);+ let comp_message = cformat!(+ "{} completions for <bold>{shell}</> @ <bold>{comp_path}</>",+ comp_result.action.description()+ );+ match comp_result.action {+ ConfigAction::Added | ConfigAction::Created => {+ super::print(success_message(comp_message))?;+ }+ ConfigAction::AlreadyExists => {+ super::print(info_message(comp_message))?;+ }+ ConfigAction::WouldAdd | ConfigAction::WouldCreate => {+ unreachable!("Preview actions handled by confirmation prompt")+ }+ }+ }+ }++ // Show skipped shells+ print_skipped_shells(&scan_result.skipped)?;++ // Summary+ if shells_configured_count > 0 {+ super::blank()?;+ let plural = if shells_configured_count == 1 {+ ""+ } else {+ "s"+ };+ super::print(success_message(format!(+ "Configured {shells_configured_count} shell{plural}"+ )))?;+ } else {+ super::print(success_message("All shells already configured"))?;+ }++ // Zsh compinit advisory+ if scan_result.zsh_needs_compinit {+ super::print(warning_message(+ "Completions require compinit; add to ~/.zshrc before the wt line:",+ ))?;+ super::print(format_bash_with_gutter("autoload -Uz compinit && compinit"))?;+ }++ // Restart hint for current shell+ if shells_configured_count > 0 {+ let current_shell = std::env::var("SHELL")+ .ok()+ .and_then(|s| s.rsplit('/').next().map(String::from));++ let current_shell_result = current_shell.as_ref().and_then(|shell_name| {+ scan_result+ .configured+ .iter()+ .filter(|r| !matches!(r.action, ConfigAction::AlreadyExists))+ .find(|r| r.shell.to_string().eq_ignore_ascii_case(shell_name))+ });++ if let Some(result) = current_shell_result {+ // Fish auto-sources from conf.d, so just say "Restart shell"+ // Bash/Zsh can source directly for immediate activation+ if matches!(result.shell, Shell::Fish) {+ super::print(hint_message("Restart shell to activate"))?;+ } else {+ let path = format_path_for_display(&result.path);+ super::print(hint_message(cformat!(+ "Restart shell or run: <bright-black>source {path}</>"+ )))?;+ }+ }+ }++ Ok(())+}++/// Handle shell integration prompt/hint after switch when shell integration is not active.+///+/// Called after `wt switch` when shell integration is NOT active.+///+/// ## Decision Flow (checked in order)+///+/// | Condition | Action |+/// |-----------|--------|+/// | Unsupported shell | Hint: `Shell integration not yet supported for <shell> (supports bash, zsh, fish, PowerShell)` |+/// | $SHELL not set | Hint: `To enable automatic cd, run wt config shell install` |+/// | Current shell already installed | Hint: `Restart shell to activate shell integration` |+/// | `skip-shell-integration-prompt` | Hint: `To enable automatic cd, run wt config shell install` |+/// | TTY | Prompt: `❯ Install shell integration? [y/N/?]` |+/// | Non-TTY / `--execute` | Hint: `To enable automatic cd, run wt config shell install` |+///+/// When prompting:+/// 1. Show prompt with preview of ALL shells that would be configured+/// 2. On accept, install for ALL shells (equivalent to `wt config shell install`)+/// 3. On decline, set `skip-shell-integration-prompt = true` and show hint+/// 4. On Ctrl+C, exit without setting skip flag (will prompt again next time)+///+/// ## Rationale+///+/// - **Installs all shells**: Accepting is equivalent to `wt config shell install`, not just+/// the current shell. This sets up the user for switching shells later.+/// - **Skip flag only on explicit decline**: Ctrl+C doesn't set the flag, so users who+/// interrupted can see the prompt again next time.+/// - **First-time users (TTY)**: Get a one-time prompt with option to preview (`?`) before deciding+/// - **Users who declined (TTY)**: Get a reminder hint on each switch+/// - **Users with stale install**: Already have the config line, just need to restart shell+/// - **Non-interactive (non-TTY)**: Always show hint (can't prompt)+/// - **Unknown shell**: Show unsupported message+///+/// Returns `Ok(true)` if installed, `Ok(false)` otherwise.+pub fn prompt_shell_integration(+ config: &mut WorktrunkConfig,+ binary_name: &str,+ skip_prompt: bool,+) -> anyhow::Result<bool> {+ use crate::commands::configure_shell::{+ ConfigAction, handle_configure_shell, prompt_for_install, scan_shell_configs,+ };+ use std::io::IsTerminal;+ use worktrunk::shell::current_shell;++ let is_tty = std::io::stdin().is_terminal() && std::io::stderr().is_terminal();++ // Check the current shell (from $SHELL)+ // Only prompt if current shell is supported (so they benefit immediately)+ let shell_env = std::env::var("SHELL").ok();+ if current_shell().is_none() {+ let msg = match &shell_env {+ Some(path) => shell_integration_unsupported_shell(path),+ // $SHELL not set: could be Windows PowerShell, or unusual Unix setup+ // Point them to manual installation+ None => shell_integration_hint(),+ };+ super::print(hint_message(msg))?;+ return Ok(false);+ };++ // Scan ALL shells (same as `wt config shell install`)+ // Only includes shells where config files already exist+ let scan = scan_shell_configs(None, true, binary_name)+ .map_err(|e| anyhow::anyhow!("Failed to scan shell configs: {e}"))?;++ // No config files exist - show install hint+ if scan.configured.is_empty() {+ super::print(hint_message(shell_integration_hint()))?;+ return Ok(false);+ }++ // Check if current shell is already configured (user just needs to restart)+ let current_shell_installed = scan+ .configured+ .iter()+ .filter(|r| Some(r.shell) == current_shell())+ .any(|r| matches!(r.action, ConfigAction::AlreadyExists));++ if current_shell_installed {+ super::print(hint_message("Restart shell to activate shell integration"))?;+ return Ok(false);+ }++ // Already prompted before (they declined) - show install hint+ if config.skip_shell_integration_prompt {+ super::print(hint_message(shell_integration_hint()))?;+ return Ok(false);+ }++ // Non-TTY or skip_prompt: Show hint (can't or shouldn't prompt interactively)+ if !is_tty || skip_prompt {+ super::print(hint_message(shell_integration_hint()))?;+ return Ok(false);+ }++ // TTY + first time: Show interactive prompt+ // Accepting installs for all shells with config files (same as `wt config shell install`)+ super::blank()?;+ let confirmed = prompt_for_install(+ &scan.configured,+ &scan.completion_results,+ binary_name,+ "Install shell integration?",+ )+ .map_err(|e| anyhow::anyhow!("{e}"))?;++ if !confirmed {+ // Only skip future prompts after explicit decline (not Ctrl+C)+ let _ = config.set_skip_shell_integration_prompt(None);+ super::print(hint_message(shell_integration_hint()))?;+ return Ok(false);+ }++ // Install for all shells with config files (same as `wt config shell install`)+ let install_result = handle_configure_shell(None, true, binary_name.to_string())+ .map_err(|e| anyhow::anyhow!("Failed to configure shell integration: {e}"))?;++ print_shell_install_result(&install_result)?;++ Ok(true)}/// Show switch message when changing directory after worktree removal@@ -367,7 +653,6 @@ pub fn handle_switch_output(if let Some(warning) = path_mismatch_warning {super::print(warning)?;}- super::shell_integration_hint(shell_integration_hint())?;}}SwitchResult::Created {@@ -383,10 +668,6 @@ pub fn handle_switch_output(base_branch.as_deref(),from_remote.as_deref(),)))?;- // Show setup hint if no execute command (hint suppressed when shell integration is active)- if !has_execute_command {- super::shell_integration_hint(shell_integration_hint())?;- }}}diff --git a/src/output/mod.rs b/src/output/mod.rsindex 048345974..4349594da 100644--- a/src/output/mod.rs+++ b/src/output/mod.rs@@ -31,10 +31,11 @@ pub mod handlers;// Re-export the public APIpub use global::{- blank, change_directory, execute, flush, is_shell_integration_active, print,- shell_integration_hint, stdout, terminate_output,+ blank, change_directory, execute, flush, is_shell_integration_active, print, stdout,+ terminate_output,};// Re-export output handlerspub use handlers::{execute_command_in_worktree, execute_user_command, handle_remove_output, handle_switch_output,+ print_shell_install_result, print_skipped_shells, prompt_shell_integration,};diff --git a/src/shell.rs b/src/shell.rsindex 245be8f43..ad475257f 100644--- a/src/shell.rs+++ b/src/shell.rs@@ -646,6 +646,36 @@ pub fn detect_zsh_compinit() -> Option<bool> {}}+/// Get the current shell from `$SHELL` environment variable.+///+/// Returns `None` if `$SHELL` is not set or doesn't match a known shell.+/// Handles versioned/prefixed binaries like `/nix/store/.../zsh-5.9` or `bash5`+/// by checking if the name starts with a known shell.+pub fn current_shell() -> Option<Shell> {+ let shell_path = std::env::var("SHELL").ok()?;+ let shell_name = shell_path.rsplit('/').next()?;++ // Try exact match first+ if let Ok(shell) = shell_name.parse() {+ return Some(shell);+ }++ // Handle versioned/prefixed binaries (e.g., "zsh-5.9", "bash5")+ // Check if shell name starts with a known shell+ let name_lower = shell_name.to_lowercase();+ if name_lower.starts_with("zsh") {+ Some(Shell::Zsh)+ } else if name_lower.starts_with("bash") {+ Some(Shell::Bash)+ } else if name_lower.starts_with("fish") {+ Some(Shell::Fish)+ } else if name_lower.starts_with("pwsh") || name_lower.starts_with("powershell") {+ Some(Shell::PowerShell)+ } else {+ None+ }+}+/// Check if the current shell is zsh (based on $SHELL environment variable).////// Used to determine if the user's primary shell is zsh when running `install`@@ -653,9 +683,7 @@ pub fn detect_zsh_compinit() -> Option<bool> {/// hints; if they're using bash/fish, we skip the hint since zsh isn't their/// daily driver.pub fn is_current_shell_zsh() -> bool {- std::env::var("SHELL")- .map(|s| s.ends_with("/zsh") || s.ends_with("/zsh-"))- .unwrap_or(false)+ current_shell() == Some(Shell::Zsh)}#[cfg(test)]diff --git a/tests/common/mod.rs b/tests/common/mod.rsindex 6c277a919..9a776ecd6 100644--- a/tests/common/mod.rs+++ b/tests/common/mod.rs@@ -925,6 +925,12 @@ impl TestRepo {),// Prevent git from prompting for credentials when running under a TTY("GIT_TERMINAL_PROMPT".to_string(), "0".to_string()),+ // Use test-specific home directory for isolation+ ("HOME".to_string(), self.home_path().display().to_string()),+ (+ "XDG_CONFIG_HOME".to_string(),+ self.home_path().join(".config").display().to_string(),+ ),("LC_ALL".to_string(), "C".to_string()),("LANG".to_string(), "C".to_string()),("SOURCE_DATE_EPOCH".to_string(), TEST_EPOCH.to_string()),@@ -935,6 +941,21 @@ impl TestRepo {]}+ /// Configure shell integration for test environment.+ ///+ /// Writes the shell config line to `.zshrc` in the test home directory.+ /// Call this before tests that need shell integration to appear configured.+ /// The test should also include `SHELL=/bin/zsh` in its env vars.+ #[cfg_attr(windows, allow(dead_code))] // Used only by unix PTY tests+ pub fn configure_shell_integration(&self) {+ let zshrc_path = self.home_path().join(".zshrc");+ std::fs::write(+ &zshrc_path,+ "if command -v wt >/dev/null 2>&1; then eval \"$(command wt config shell init zsh)\"; fi\n",+ )+ .expect("Failed to write .zshrc for test");+ }+/// Create a `git` command pre-configured for this test repo.////// Returns an isolated Command with test-specific git config.diff --git a/tests/integration_tests/approval_pty.rs b/tests/integration_tests/approval_pty.rsindex 685fc02bb..7885c089d 100644--- a/tests/integration_tests/approval_pty.rs+++ b/tests/integration_tests/approval_pty.rs@@ -79,11 +79,24 @@ fn normalize_output(output: &str) -> String {.unwrap().replace_all(output, "");- // Remove repository paths+ // Remove repository paths (macOS uses .tmp dirs like /var/folders/.../test.tmpXXX)+ // Match repo.branch-name but not trailing ANSI codes (which start with escape char \x1b)+ let output = regex::Regex::new(r"/[^\s]+\.tmp[^\s/]+/repo\.[a-zA-Z0-9_-]+")+ .unwrap()+ .replace_all(&output, "_REPO_/repo.BRANCH");++ // Also normalize remaining .tmp paths (for non-worktree paths)let output = regex::Regex::new(r"/[^\s]+\.tmp[^\s/]+").unwrap().replace_all(&output, "_REPO_");+ // Normalize worktree paths that show as ~/repo.branch-name+ // When HOME is set to the test temp dir, format_path_for_display abbreviates to ~+ // Match branch names but not trailing ANSI codes+ let output = regex::Regex::new(r"~/repo\.[a-zA-Z0-9_-]+")+ .unwrap()+ .replace_all(&output, "_REPO_/repo.BRANCH");+// Remove config pathslet output = regex::Regex::new(r"/var/folders/[^\s]+/test-config\.toml").unwrap()@@ -123,12 +136,26 @@ fn normalize_output(output: &str) -> String {output_str}+/// Get test env vars with shell integration configured.+///+/// This adds SHELL=/bin/zsh to the env vars, which is needed because:+/// - Tests write to .zshrc to simulate configured shell integration+/// - scan_shell_configs() uses $SHELL to determine which config file to check+/// - Without this, CI (which has SHELL=/bin/bash) wouldn't find the .zshrc config+fn test_env_vars_with_shell(repo: &TestRepo) -> Vec<(String, String)> {+ let mut env_vars = repo.test_env_vars();+ env_vars.push(("SHELL".to_string(), "/bin/zsh".to_string()));+ env_vars+}+#[rstest]fn test_approval_prompt_accept(repo: TestRepo) {repo.write_project_config(r#"post-create = "echo 'test command'""#);repo.commit("Add config");- let env_vars = repo.test_env_vars();+ // Configure shell integration so we get the "Restart shell" hint instead of the prompt+ repo.configure_shell_integration();+ let env_vars = test_env_vars_with_shell(&repo);let (output, exit_code) = exec_in_pty_with_input(get_cargo_bin("wt").to_str().unwrap(),&["switch", "--create", "test-approve"],@@ -147,7 +174,9 @@ fn test_approval_prompt_decline(repo: TestRepo) {repo.write_project_config(r#"post-create = "echo 'test command'""#);repo.commit("Add config");- let env_vars = repo.test_env_vars();+ // Configure shell integration so we get the "Restart shell" hint instead of the prompt+ repo.configure_shell_integration();+ let env_vars = test_env_vars_with_shell(&repo);let (output, exit_code) = exec_in_pty_with_input(get_cargo_bin("wt").to_str().unwrap(),&["switch", "--create", "test-decline"],@@ -172,7 +201,9 @@ third = "echo 'Third command'");repo.commit("Add config");- let env_vars = repo.test_env_vars();+ // Configure shell integration so we get the "Restart shell" hint instead of the prompt+ repo.configure_shell_integration();+ let env_vars = test_env_vars_with_shell(&repo);let (output, exit_code) = exec_in_pty_with_input(get_cargo_bin("wt").to_str().unwrap(),&["switch", "--create", "test-multi"],@@ -219,7 +250,9 @@ fn test_approval_prompt_permission_error(repo: TestRepo) {}}- let env_vars = repo.test_env_vars();+ // Configure shell integration so we get the "Restart shell" hint instead of the prompt+ repo.configure_shell_integration();+ let env_vars = test_env_vars_with_shell(&repo);let (output, exit_code) = exec_in_pty_with_input(get_cargo_bin("wt").to_str().unwrap(),&["switch", "--create", "test-permission"],@@ -259,7 +292,9 @@ test = "echo 'Running tests...'");repo.commit("Add config");- let env_vars = repo.test_env_vars();+ // Configure shell integration so we get the "Restart shell" hint instead of the prompt+ repo.configure_shell_integration();+ let env_vars = test_env_vars_with_shell(&repo);let (output, exit_code) = exec_in_pty_with_input(get_cargo_bin("wt").to_str().unwrap(),&["switch", "--create", "test-named"],@@ -305,7 +340,9 @@ approved-commands = ["echo 'Second command'"]project_id));- let env_vars = repo.test_env_vars();+ // Configure shell integration so we get the "Restart shell" hint instead of the prompt+ repo.configure_shell_integration();+ let env_vars = test_env_vars_with_shell(&repo);let (output, exit_code) = exec_in_pty_with_input(get_cargo_bin("wt").to_str().unwrap(),&["switch", "--create", "test-mixed-accept"],@@ -362,7 +399,9 @@ approved-commands = ["echo 'Second command'"]project_id));- let env_vars = repo.test_env_vars();+ // Configure shell integration so we get the "Restart shell" hint instead of the prompt+ repo.configure_shell_integration();+ let env_vars = test_env_vars_with_shell(&repo);let (output, exit_code) = exec_in_pty_with_input(get_cargo_bin("wt").to_str().unwrap(),&["switch", "--create", "test-mixed-decline"],diff --git a/tests/integration_tests/approval_save.rs b/tests/integration_tests/approval_save.rsindex 067559009..8e72ce79c 100644--- a/tests/integration_tests/approval_save.rs+++ b/tests/integration_tests/approval_save.rs@@ -5,7 +5,7 @@ use worktrunk::config::WorktrunkConfig;/// Test that approved commands are actually persisted to disk///-/// This test uses `approve_command_to()` to ensure it never writes to the user's config+/// This test uses `approve_command()` to ensure it never writes to the user's config#[test]fn test_approval_saves_to_disk() {let temp_dir = TempDir::new().unwrap();@@ -16,7 +16,7 @@ fn test_approval_saves_to_disk() {// Add an approval to the explicit pathconfig- .approve_command_to(+ .approve_command("github.com/test/repo".to_string(),"test command".to_string(),Some(&config_path),@@ -58,14 +58,14 @@ fn test_duplicate_approvals_not_saved_twice() {// Add same approval twiceconfig- .approve_command_to(+ .approve_command("github.com/test/repo".to_string(),"test".to_string(),Some(&config_path),).ok();config- .approve_command_to(+ .approve_command("github.com/test/repo".to_string(),"test".to_string(),Some(&config_path),@@ -111,21 +111,21 @@ fn test_multiple_project_approvals() {// Add approvals for different projectsconfig- .approve_command_to(+ .approve_command("github.com/user1/repo1".to_string(),"npm install".to_string(),Some(&config_path),).unwrap();config- .approve_command_to(+ .approve_command("github.com/user2/repo2".to_string(),"cargo build".to_string(),Some(&config_path),).unwrap();config- .approve_command_to(+ .approve_command("github.com/user1/repo1".to_string(),"npm test".to_string(),Some(&config_path),@@ -185,7 +185,7 @@ fn test_isolated_config_safety() {// Create isolated config and make changeslet mut config = WorktrunkConfig::default();config- .approve_command_to(+ .approve_command("github.com/safety-test/repo".to_string(),"THIS SHOULD NOT APPEAR IN USER CONFIG".to_string(),Some(&config_path),@@ -250,7 +250,7 @@ fn test_approval_saves_to_new_config_file() {// Create a config and savelet mut config = WorktrunkConfig::default();config- .approve_command_to(+ .approve_command("github.com/test/nested".to_string(),"test command".to_string(),Some(&config_path),@@ -307,7 +307,7 @@ args = ["-s"]// Add an approval and save back to the same fileconfig- .approve_command_to(+ .approve_command("github.com/test/repo".to_string(),"npm install".to_string(),Some(&config_path),@@ -356,7 +356,7 @@ fn test_concurrent_approve_preserves_all_approvals() {// Process A approves and saves "npm install"config_a- .approve_command_to(+ .approve_command("github.com/user/repo".to_string(),"npm install".to_string(),Some(&config_path),@@ -373,7 +373,7 @@ fn test_concurrent_approve_preserves_all_approvals() {// Process B (which loaded BEFORE Process A saved) now approves and saves "npm test"// The save_to method should merge with what's on disk, not overwriteconfig_b- .approve_command_to(+ .approve_command("github.com/user/repo".to_string(),"npm test".to_string(),Some(&config_path),@@ -409,14 +409,14 @@ fn test_concurrent_revoke_preserves_all_changes() {// Setup: config file has two commands approvedlet mut setup_config = WorktrunkConfig::default();setup_config- .approve_command_to(+ .approve_command("github.com/user/repo".to_string(),"npm install".to_string(),Some(&config_path),).unwrap();setup_config- .approve_command_to(+ .approve_command("github.com/user/repo".to_string(),"npm test".to_string(),Some(&config_path),@@ -446,13 +446,13 @@ fn test_concurrent_revoke_preserves_all_changes() {// Process A revokes "npm install"config_a- .revoke_command_to("github.com/user/repo", "npm install", Some(&config_path))+ .revoke_command("github.com/user/repo", "npm install", Some(&config_path)).unwrap();// Process B (with stale state) revokes "npm test"// Should see that "npm install" was already revoked and preserve thatconfig_b- .revoke_command_to("github.com/user/repo", "npm test", Some(&config_path))+ .revoke_command("github.com/user/repo", "npm test", Some(&config_path)).unwrap();// Read the final state from disk@@ -483,7 +483,7 @@ fn test_concurrent_approve_different_projects() {// Process A approves for project1config_a- .approve_command_to(+ .approve_command("github.com/user/project1".to_string(),"npm install".to_string(),Some(&config_path),@@ -493,7 +493,7 @@ fn test_concurrent_approve_different_projects() {// Process B approves for project2// Should preserve project1's approvalconfig_b- .approve_command_to(+ .approve_command("github.com/user/project2".to_string(),"cargo build".to_string(),Some(&config_path),@@ -522,7 +522,7 @@ fn test_concurrent_approve_different_projects() {/// Test that permission errors when saving config are handled gracefully///-/// This tests the lower-level `approve_command_to()` method fails when permissions+/// This tests the lower-level `approve_command()` method fails when permissions/// are denied. The higher-level `approve_command_batch()` catches this error and/// displays a warning (see src/commands/command_approval.rs:82-85), allowing/// commands to execute even when the approval can't be saved.@@ -570,7 +570,7 @@ fn test_permission_error_prevents_save() {// Try to save a new approval - this should faillet mut config = WorktrunkConfig::default();- let result = config.approve_command_to(+ let result = config.approve_command("github.com/test/readonly".to_string(),"test command".to_string(),Some(&config_path),@@ -599,6 +599,62 @@ fn test_permission_error_prevents_save() {// This test verifies the save operation correctly fails with permission errors.}+/// Test that set_skip_shell_integration_prompt saves to disk+#[test]+fn test_skip_shell_integration_prompt_saves_to_disk() {+ let temp_dir = TempDir::new().unwrap();+ let config_path = temp_dir.path().join("worktrunk").join("config.toml");++ let mut config = WorktrunkConfig::default();+ config+ .set_skip_shell_integration_prompt(Some(&config_path))+ .unwrap();++ // Verify file was created+ assert!(+ config_path.exists(),+ "Config file was not created at {:?}",+ config_path+ );++ // Verify TOML structure+ let toml_content = fs::read_to_string(&config_path).unwrap();+ assert_snapshot!(toml_content, @r#"+ worktree-path = "../{{ main_worktree }}.{{ branch | sanitize }}"+ skip-shell-integration-prompt = true++ [commit-generation]+ args = []+ "#);+}++/// Test that set_skip_shell_integration_prompt is idempotent+#[test]+fn test_skip_shell_integration_prompt_idempotent() {+ let temp_dir = TempDir::new().unwrap();+ let config_path = temp_dir.path().join("config.toml");++ let mut config = WorktrunkConfig::default();++ // Call twice - should not error+ config+ .set_skip_shell_integration_prompt(Some(&config_path))+ .unwrap();+ config+ .set_skip_shell_integration_prompt(Some(&config_path))+ .unwrap();++ // Field should still be true+ assert!(config.skip_shell_integration_prompt);++ // File should have the flag exactly once+ let toml_content = fs::read_to_string(&config_path).unwrap();+ let count = toml_content+ .matches("skip-shell-integration-prompt")+ .count();+ assert_eq!(count, 1, "Flag should appear exactly once");+}+/// Test that saving config through a symlink preserves the symlink////// When the config file is a symlink (e.g., user has config.toml -> dotfiles/worktrunk.toml),@@ -643,7 +699,7 @@ command = "llm"let mut config: WorktrunkConfig = toml::from_str(&toml_str).unwrap();config- .approve_command_to(+ .approve_command("github.com/test/symlink-repo".to_string(),"npm install".to_string(),Some(&symlink_path),diff --git a/tests/integration_tests/approvals.rs b/tests/integration_tests/approvals.rsindex 7e8278363..e6610d4c2 100644--- a/tests/integration_tests/approvals.rs+++ b/tests/integration_tests/approvals.rs@@ -69,7 +69,7 @@ fn test_clear_approvals_with_approvals(repo: TestRepo) {// Manually approve the command by writing to test configlet mut config = WorktrunkConfig::default();config- .approve_command_to(+ .approve_command(project_id,"echo 'test'".to_string(),Some(repo.test_config_path()),@@ -95,7 +95,7 @@ fn test_clear_approvals_global_with_approvals(repo: TestRepo) {// Manually approve the commandlet mut config = WorktrunkConfig::default();config- .approve_command_to(+ .approve_command(project_id,"echo 'test'".to_string(),Some(repo.test_config_path()),@@ -120,7 +120,7 @@ fn test_clear_approvals_after_clear(repo: TestRepo) {// Manually approve the commandlet mut config = WorktrunkConfig::default();config- .approve_command_to(+ .approve_command(project_id.clone(),"echo 'test'".to_string(),Some(repo.test_config_path()),@@ -152,21 +152,21 @@ lint = "echo 'third'"let project_id = format!("{}/origin", repo.root_path().display());let mut config = WorktrunkConfig::default();config- .approve_command_to(+ .approve_command(project_id.clone(),"echo 'first'".to_string(),Some(repo.test_config_path()),).unwrap();config- .approve_command_to(+ .approve_command(project_id.clone(),"echo 'second'".to_string(),Some(repo.test_config_path()),).unwrap();config- .approve_command_to(+ .approve_command(project_id,"echo 'third'".to_string(),Some(repo.test_config_path()),@@ -191,7 +191,7 @@ fn test_add_approvals_all_already_approved(repo: TestRepo) {// Manually approve the commandlet mut config = WorktrunkConfig::default();config- .approve_command_to(+ .approve_command(project_id,"echo 'test'".to_string(),Some(repo.test_config_path()),diff --git a/tests/integration_tests/configure_shell.rs b/tests/integration_tests/configure_shell.rsindex c2f44b98e..5c9ec74d6 100644--- a/tests/integration_tests/configure_shell.rs+++ b/tests/integration_tests/configure_shell.rs@@ -34,13 +34,13 @@ fn test_configure_shell_with_yes(repo: TestRepo, temp_home: TempDir) {----- stderr -----[32m✓[39m [32mAdded shell extension & completions for [1mzsh[22m @ [1m~/.zshrc[22m[39m- [2m↳[22m [2mSkipped [90mbash[39m; ~/.bashrc not found[22m- [2m↳[22m [2mSkipped [90mfish[39m; ~/.config/fish/conf.d not found[22m+ [2m↳[22m [2mSkipped [90mbash[39m; [90m~/.bashrc[39m not found[22m+ [2m↳[22m [2mSkipped [90mfish[39m; [90m~/.config/fish/conf.d[39m not found[22m[32m✓[39m [32mConfigured 1 shell[39m[33m▲[39m [33mCompletions require compinit; add to ~/.zshrc before the wt line:[39m[107m [0m [2m[0m[2m[34mautoload[0m[2m [0m[2m[36m-Uz[0m[2m compinit [0m[2m[36m&&[0m[2m [0m[2m[34mcompinit[0m[2m[0m- [2m↳[22m [2mRestart shell or run: source ~/.zshrc[22m+ [2m↳[22m [2mRestart shell or run: [90msource ~/.zshrc[39m[22m");});@@ -82,7 +82,7 @@ fn test_configure_shell_specific_shell(repo: TestRepo, temp_home: TempDir) {[32m✓[39m [32mConfigured 1 shell[39m[33m▲[39m [33mCompletions require compinit; add to ~/.zshrc before the wt line:[39m[107m [0m [2m[0m[2m[34mautoload[0m[2m [0m[2m[36m-Uz[0m[2m compinit [0m[2m[36m&&[0m[2m [0m[2m[34mcompinit[0m[2m[0m- [2m↳[22m [2mRestart shell or run: source ~/.zshrc[22m+ [2m↳[22m [2mRestart shell or run: [90msource ~/.zshrc[39m[22m");});@@ -287,9 +287,9 @@ fn test_configure_shell_no_files(repo: TestRepo, temp_home: TempDir) {----- stdout ---------- stderr ------ [2m↳[22m [2mSkipped [90mbash[39m; ~/.bashrc not found[22m- [2m↳[22m [2mSkipped [90mzsh[39m; ~/.zshrc not found[22m- [2m↳[22m [2mSkipped [90mfish[39m; ~/.config/fish/conf.d not found[22m+ [2m↳[22m [2mSkipped [90mbash[39m; [90m~/.bashrc[39m not found[22m+ [2m↳[22m [2mSkipped [90mzsh[39m; [90m~/.zshrc[39m not found[22m+ [2m↳[22m [2mSkipped [90mfish[39m; [90m~/.config/fish/conf.d[39m not found[22m[31m✗[39m [31mNo shell config files found[39m");});@@ -326,12 +326,12 @@ fn test_configure_shell_multiple_configs(repo: TestRepo, temp_home: TempDir) {----- stderr -----[32m✓[39m [32mAdded shell extension & completions for [1mbash[22m @ [1m~/.bashrc[22m[39m[32m✓[39m [32mAdded shell extension & completions for [1mzsh[22m @ [1m~/.zshrc[22m[39m- [2m↳[22m [2mSkipped [90mfish[39m; ~/.config/fish/conf.d not found[22m+ [2m↳[22m [2mSkipped [90mfish[39m; [90m~/.config/fish/conf.d[39m not found[22m[32m✓[39m [32mConfigured 2 shells[39m[33m▲[39m [33mCompletions require compinit; add to ~/.zshrc before the wt line:[39m[107m [0m [2m[0m[2m[34mautoload[0m[2m [0m[2m[36m-Uz[0m[2m compinit [0m[2m[36m&&[0m[2m [0m[2m[34mcompinit[0m[2m[0m- [2m↳[22m [2mRestart shell or run: source ~/.zshrc[22m+ [2m↳[22m [2mRestart shell or run: [90msource ~/.zshrc[39m[22m");});@@ -386,12 +386,12 @@ fn test_configure_shell_mixed_states(repo: TestRepo, temp_home: TempDir) {----- stderr -----[2m○[22m Already configured shell extension & completions for [1mbash[22m @ [1m~/.bashrc[22m[32m✓[39m [32mAdded shell extension & completions for [1mzsh[22m @ [1m~/.zshrc[22m[39m- [2m↳[22m [2mSkipped [90mfish[39m; ~/.config/fish/conf.d not found[22m+ [2m↳[22m [2mSkipped [90mfish[39m; [90m~/.config/fish/conf.d[39m not found[22m[32m✓[39m [32mConfigured 1 shell[39m[33m▲[39m [33mCompletions require compinit; add to ~/.zshrc before the wt line:[39m[107m [0m [2m[0m[2m[34mautoload[0m[2m [0m[2m[36m-Uz[0m[2m compinit [0m[2m[36m&&[0m[2m [0m[2m[34mcompinit[0m[2m[0m- [2m↳[22m [2mRestart shell or run: source ~/.zshrc[22m+ [2m↳[22m [2mRestart shell or run: [90msource ~/.zshrc[39m[22m");});@@ -765,7 +765,7 @@ fn test_configure_shell_no_warning_when_compinit_enabled(repo: TestRepo, temp_ho[32m✓[39m [32mAdded shell extension & completions for [1mzsh[22m @ [1m~/.zshrc[22m[39m[32m✓[39m [32mConfigured 1 shell[39m- [2m↳[22m [2mRestart shell or run: source ~/.zshrc[22m+ [2m↳[22m [2mRestart shell or run: [90msource ~/.zshrc[39m[22m");});}@@ -801,10 +801,10 @@ fn test_configure_shell_no_warning_for_bash_user(repo: TestRepo, temp_home: Temp----- stderr -----[32m✓[39m [32mAdded shell extension & completions for [1mbash[22m @ [1m~/.bashrc[22m[39m[32m✓[39m [32mAdded shell extension & completions for [1mzsh[22m @ [1m~/.zshrc[22m[39m- [2m↳[22m [2mSkipped [90mfish[39m; ~/.config/fish/conf.d not found[22m+ [2m↳[22m [2mSkipped [90mfish[39m; [90m~/.config/fish/conf.d[39m not found[22m[32m✓[39m [32mConfigured 2 shells[39m- [2m↳[22m [2mRestart shell or run: source ~/.bashrc[22m+ [2m↳[22m [2mRestart shell or run: [90msource ~/.bashrc[39m[22m");});}@@ -912,7 +912,7 @@ fn test_configure_shell_no_warning_when_shell_unset(repo: TestRepo, temp_home: T----- stderr -----[32m✓[39m [32mAdded shell extension & completions for [1mbash[22m @ [1m~/.bashrc[22m[39m[32m✓[39m [32mAdded shell extension & completions for [1mzsh[22m @ [1m~/.zshrc[22m[39m- [2m↳[22m [2mSkipped [90mfish[39m; ~/.config/fish/conf.d not found[22m+ [2m↳[22m [2mSkipped [90mfish[39m; [90m~/.config/fish/conf.d[39m not found[22m[32m✓[39m [32mConfigured 2 shells[39m");diff --git a/tests/integration_tests/mod.rs b/tests/integration_tests/mod.rsindex 8106ffd28..94e3c48b0 100644--- a/tests/integration_tests/mod.rs+++ b/tests/integration_tests/mod.rs@@ -43,6 +43,7 @@ pub mod remove;pub mod repository;pub mod security;pub mod select;+pub mod shell_integration_prompt;pub mod shell_wrapper;pub mod spacing_edge_cases;pub mod statusline;diff --git a/tests/integration_tests/shell_integration_prompt.rs b/tests/integration_tests/shell_integration_prompt.rsnew file mode 100644index 000000000..187536a8f--- /dev/null+++ b/tests/integration_tests/shell_integration_prompt.rs@@ -0,0 +1,569 @@+//! Tests for the shell integration first-run prompt+//!+//! These tests verify that `prompt_shell_integration` behaves correctly across scenarios:+//! - Skips when shell integration is active (WORKTRUNK_DIRECTIVE_FILE set)+//! - Skips when already prompted (config flag true)+//! - Skips when already installed (config line exists in shell config)+//! - Shows hint when not a TTY (non-interactive)+//! - Prompts and respects user's choice in interactive mode++use crate::common::{TestRepo, repo};+use rstest::rstest;+use std::fs;+use worktrunk::config::WorktrunkConfig;++/// Test that switch with active shell integration doesn't trigger prompt+///+/// When WORKTRUNK_DIRECTIVE_FILE is set (shell integration active), we should:+/// 1. Never call prompt_shell_integration()+/// 2. Have zero overhead from the prompt feature+#[rstest]+fn test_switch_with_active_shell_integration_no_prompt(repo: TestRepo) {+ // Create a worktree first+ let create_output = repo+ .wt_command()+ .args(["switch", "--create", "feature"])+ .output()+ .unwrap();+ assert!(+ create_output.status.success(),+ "First switch should succeed: {}",+ String::from_utf8_lossy(&create_output.stderr)+ );++ // Now switch with shell integration "active" (directive file set)+ // The directive file must exist (shell wrapper creates it before calling wt)+ let directive_file = repo.root_path().join("directive.txt");+ fs::write(&directive_file, "").unwrap();+ let mut cmd = repo.wt_command();+ cmd.env("WORKTRUNK_DIRECTIVE_FILE", &directive_file);++ let output = cmd.args(["switch", "feature"]).output().unwrap();++ let stderr = String::from_utf8_lossy(&output.stderr);+ let stdout = String::from_utf8_lossy(&output.stdout);+ assert!(+ output.status.success(),+ "Switch should succeed.\nstderr: {stderr}\nstdout: {stdout}"+ );++ // The directive file should have cd command (shell integration active)+ let directive = fs::read_to_string(&directive_file).unwrap_or_default();+ assert!(+ directive.contains("cd "),+ "Directive should contain cd command when shell integration active"+ );++ // No install prompt in output (would contain "Install shell integration")+ assert!(+ !stderr.contains("Install shell integration"),+ "Should not show install prompt when shell integration active: {stderr}"+ );+}++/// Test that already-prompted flag prevents prompt+#[rstest]+fn test_switch_with_skip_prompt_flag(repo: TestRepo) {+ // Set the skip flag in config+ let config_path = repo.test_config_path();+ let mut config = WorktrunkConfig::default();+ config.skip_shell_integration_prompt = true;+ config.save_to(config_path).unwrap();++ let output = repo+ .wt_command()+ .args(["switch", "--create", "feature"])+ .output()+ .unwrap();++ assert!(output.status.success(), "Switch should succeed");++ // No install prompt in output+ let stderr = String::from_utf8_lossy(&output.stderr);+ assert!(+ !stderr.contains("Install shell integration"),+ "Should not show install prompt when already prompted: {stderr}"+ );+}++/// Test that non-TTY stdin shows hint but doesn't prompt+///+/// When stdin is not a TTY (e.g., piped input), we should:+/// - Skip the prompt (can't interact)+/// - Always show the hint (not just first run)+/// - NOT mark as prompted (hints are not prompts)+#[rstest]+fn test_switch_non_tty_shows_hint(repo: TestRepo) {+ use std::process::Stdio;++ // Run with piped stdin (not a TTY)+ let output = repo+ .wt_command()+ .args(["switch", "--create", "feature"])+ .stdin(Stdio::piped())+ .output()+ .unwrap();++ assert!(output.status.success(), "Switch should succeed");++ // Verify the switch succeeded without prompting+ let stderr = String::from_utf8_lossy(&output.stderr);+ assert!(+ stderr.contains("Created new worktree for"),+ "Should create worktree: {stderr}"+ );++ // Should show hint+ assert!(+ stderr.contains("wt config shell install"),+ "Should show install hint: {stderr}"+ );++ // Config should NOT have skip_shell_integration_prompt set (hints are not prompts)+ let config_content = fs::read_to_string(repo.test_config_path()).unwrap_or_default();+ assert!(+ !config_content.contains("skip-shell-integration-prompt"),+ "Should not mark as prompted for non-TTY (hints are not prompts): {config_content}"+ );++ // Second non-TTY run should also show hint+ let output2 = repo+ .wt_command()+ .args(["switch", "--create", "feature2"])+ .stdin(Stdio::piped())+ .output()+ .unwrap();++ let stderr2 = String::from_utf8_lossy(&output2.stderr);+ assert!(+ stderr2.contains("wt config shell install"),+ "Should show hint on every non-TTY run: {stderr2}"+ );+}++/// Test that unsupported shells show appropriate message+///+/// When SHELL is set to an unsupported shell (like tcsh), we should:+/// - Show a hint that the shell is not supported+/// - List the supported shells+#[rstest]+fn test_switch_unsupported_shell_shows_hint(repo: TestRepo) {+ use std::process::Stdio;++ // Run with an unsupported shell+ let mut cmd = repo.wt_command();+ cmd.env("SHELL", "/bin/tcsh");++ let output = cmd+ .args(["switch", "--create", "feature"])+ .stdin(Stdio::piped())+ .output()+ .unwrap();++ assert!(output.status.success(), "Switch should succeed");++ // Should show unsupported shell message+ let stderr = String::from_utf8_lossy(&output.stderr);+ assert!(+ stderr.contains("not yet supported for tcsh"),+ "Should show unsupported shell message: {stderr}"+ );+ assert!(+ stderr.contains("bash, zsh, fish, PowerShell"),+ "Should list supported shells: {stderr}"+ );+}++/// Test that unset SHELL shows install hint+///+/// When SHELL is not set (unusual Unix setup or Windows), we should:+/// - Show the standard install hint+#[rstest]+fn test_switch_no_shell_env_shows_hint(repo: TestRepo) {+ use std::process::Stdio;++ // Run without SHELL set+ let mut cmd = repo.wt_command();+ cmd.env_remove("SHELL");++ let output = cmd+ .args(["switch", "--create", "feature"])+ .stdin(Stdio::piped())+ .output()+ .unwrap();++ assert!(output.status.success(), "Switch should succeed");++ // Should show install hint+ let stderr = String::from_utf8_lossy(&output.stderr);+ assert!(+ stderr.contains("wt config shell install"),+ "Should show install hint when SHELL not set: {stderr}"+ );+}++// PTY-based tests for interactive scenarios+#[cfg(all(unix, feature = "shell-integration-tests"))]+mod pty_tests {+ use super::*;+ use crate::common::{configure_pty_command, open_pty, setup_snapshot_settings};+ use insta::assert_snapshot;+ use insta_cmd::get_cargo_bin;+ use portable_pty::CommandBuilder;+ use std::io::{Read, Write};+ use std::path::Path;+ use tempfile::TempDir;++ /// Execute a command in a PTY with interactive input+ fn exec_in_pty_with_input(+ command: &str,+ args: &[&str],+ working_dir: &Path,+ env_vars: &[(String, String)],+ home_dir: Option<&Path>,+ input: &str,+ ) -> (String, i32) {+ let pair = open_pty();++ let mut cmd = CommandBuilder::new(command);+ for arg in args {+ cmd.arg(arg);+ }+ cmd.cwd(working_dir);++ // Set up isolated environment with coverage passthrough+ configure_pty_command(&mut cmd);++ // Add test-specific environment variables+ for (key, value) in env_vars {+ cmd.env(key, value);+ }++ // Set HOME to isolated temp directory if provided+ // (must be after configure_pty_command which sets HOME to real home)+ if let Some(home) = home_dir {+ cmd.env("HOME", home.to_string_lossy().to_string());+ cmd.env(+ "XDG_CONFIG_HOME",+ home.join(".config").to_string_lossy().to_string(),+ );+ }++ let mut child = pair.slave.spawn_command(cmd).unwrap();+ drop(pair.slave);++ let mut reader = pair.master.try_clone_reader().unwrap();+ let mut writer = pair.master.take_writer().unwrap();++ // Write input to the PTY (simulating user typing)+ writer.write_all(input.as_bytes()).unwrap();+ writer.flush().unwrap();+ drop(writer);++ // Read all output+ let mut buf = String::new();+ reader.read_to_string(&mut buf).unwrap();++ let exit_status = child.wait().unwrap();+ let exit_code = exit_status.exit_code() as i32;++ (buf, exit_code)+ }++ /// Normalize output for snapshot testing+ fn normalize_output(output: &str, home_dir: &Path) -> String {+ // Remove platform-specific PTY control sequences+ let output = regex::Regex::new(r"\^D\x08+")+ .unwrap()+ .replace_all(output, "");++ // Remove repository paths+ let output = regex::Regex::new(r"/[^\s]+\.tmp[^\s/]+")+ .unwrap()+ .replace_all(&output, "[REPO]");++ // Remove home directory paths+ let home_str = home_dir.display().to_string();+ let output = output.replace(&home_str, "[HOME]");++ // PTYs use \r\n line endings, normalize to \n+ output.replace("\r\n", "\n")+ }++ /// Test: Already installed (config line exists) → skip prompt, show restart hint+ ///+ /// This covers the "installed but shell not restarted" scenario where:+ /// - Shell integration is not active (no WORKTRUNK_DIRECTIVE_FILE)+ /// - But the config line is already in shell config files+ /// - We should detect this and show a restart hint (not prompt)+ /// - We should NOT mark as prompted (no interactive prompt shown)+ #[rstest]+ fn test_already_installed_skips_prompt(repo: TestRepo) {+ // Create isolated HOME with shell config that already has integration+ let temp_home = TempDir::new().unwrap();+ let bashrc = temp_home.path().join(".bashrc");+ let config_line = "if command -v wt >/dev/null 2>&1; then eval \"$(command wt config shell init bash)\"; fi";+ fs::write(&bashrc, format!("{config_line}\n")).unwrap();++ let mut env_vars = repo.test_env_vars();+ // Remove WORKTRUNK_DIRECTIVE_FILE if present (ensure shell integration not active)+ env_vars.retain(|(k, _)| k != "WORKTRUNK_DIRECTIVE_FILE");+ // Set SHELL to bash since we're testing with .bashrc+ env_vars.push(("SHELL".to_string(), "/bin/bash".to_string()));++ let (output, exit_code) = exec_in_pty_with_input(+ get_cargo_bin("wt").to_str().unwrap(),+ &["switch", "--create", "feature"],+ repo.root_path(),+ &env_vars,+ Some(temp_home.path()),+ "", // No input needed - should not prompt+ );++ assert_eq!(exit_code, 0, "Switch should succeed");++ // Should NOT contain prompt (detected already installed)+ assert!(+ !output.contains("Install shell integration"),+ "Should not prompt when already installed: {output}"+ );++ // Should show restart hint+ assert!(+ output.contains("Restart") && output.contains("shell"),+ "Should show restart hint: {output}"+ );++ // Should have created the worktree+ assert!(+ output.contains("Created new worktree for"),+ "Should create worktree: {output}"+ );++ // Config should NOT have skip-shell-integration-prompt = true+ // (no interactive prompt shown, just a hint)+ let config_content = fs::read_to_string(repo.test_config_path()).unwrap_or_default();+ assert!(+ !config_content.contains("skip-shell-integration-prompt"),+ "Should NOT mark as prompted when just showing hint: {config_content}"+ );+ }++ /// Test: Not installed, user declines → mark prompted, no install+ #[rstest]+ fn test_user_declines_prompt(repo: TestRepo) {+ // Create isolated HOME with empty shell config+ let temp_home = TempDir::new().unwrap();+ let bashrc = temp_home.path().join(".bashrc");+ fs::write(&bashrc, "# empty bashrc\n").unwrap();++ let mut env_vars = repo.test_env_vars();+ env_vars.retain(|(k, _)| k != "WORKTRUNK_DIRECTIVE_FILE");+ // Set SHELL to bash since we're testing with .bashrc+ env_vars.push(("SHELL".to_string(), "/bin/bash".to_string()));++ let (output, exit_code) = exec_in_pty_with_input(+ get_cargo_bin("wt").to_str().unwrap(),+ &["switch", "--create", "feature"],+ repo.root_path(),+ &env_vars,+ Some(temp_home.path()),+ "n\n", // User declines+ );++ assert_eq!(exit_code, 0, "Switch should succeed even when declining");++ let normalized = normalize_output(&output, temp_home.path());++ // Should contain the prompt+ assert!(+ normalized.contains("Install shell integration"),+ "Should show prompt: {normalized}"+ );++ // Should have created the worktree+ assert!(+ normalized.contains("Created new worktree for"),+ "Should create worktree: {normalized}"+ );++ // Config should have skip-shell-integration-prompt = true+ let config_content = fs::read_to_string(repo.test_config_path()).unwrap_or_default();+ assert!(+ config_content.contains("skip-shell-integration-prompt = true"),+ "Should mark as prompted after decline: {config_content}"+ );++ // Shell config should NOT have the integration line+ let bashrc_content = fs::read_to_string(&bashrc).unwrap();+ assert!(+ !bashrc_content.contains("eval \"$(command wt"),+ "Should not install when declined: {bashrc_content}"+ );++ // Snapshot the output+ let settings = setup_snapshot_settings(&repo);+ settings.bind(|| {+ assert_snapshot!("prompt_decline", normalized);+ });+ }++ /// Test: Not installed, user accepts → install and show success+ #[rstest]+ fn test_user_accepts_prompt(repo: TestRepo) {+ // Create isolated HOME with empty shell config+ let temp_home = TempDir::new().unwrap();+ let bashrc = temp_home.path().join(".bashrc");+ fs::write(&bashrc, "# empty bashrc\n").unwrap();++ let mut env_vars = repo.test_env_vars();+ env_vars.retain(|(k, _)| k != "WORKTRUNK_DIRECTIVE_FILE");+ // Set SHELL to bash since we're testing with .bashrc+ env_vars.push(("SHELL".to_string(), "/bin/bash".to_string()));++ let (output, exit_code) = exec_in_pty_with_input(+ get_cargo_bin("wt").to_str().unwrap(),+ &["switch", "--create", "feature"],+ repo.root_path(),+ &env_vars,+ Some(temp_home.path()),+ "y\n", // User accepts+ );++ assert_eq!(exit_code, 0, "Switch should succeed");++ let normalized = normalize_output(&output, temp_home.path());++ // Should contain the prompt+ assert!(+ normalized.contains("Install shell integration"),+ "Should show prompt: {normalized}"+ );++ // Should show success message for configuration+ assert!(+ normalized.contains("Configured") && normalized.contains("bash"),+ "Should show configured message: {normalized}"+ );++ // Config should NOT have skip-shell-integration-prompt after accept+ // (only set after explicit decline - if they uninstall, they can be prompted again)+ let config_content = fs::read_to_string(repo.test_config_path()).unwrap_or_default();+ assert!(+ !config_content.contains("skip-shell-integration-prompt = true"),+ "Should not set skip flag after accept (installation itself prevents future prompts): {config_content}"+ );++ // Shell config SHOULD have the integration line+ let bashrc_content = fs::read_to_string(&bashrc).unwrap();+ assert!(+ bashrc_content.contains("eval \"$(command wt"),+ "Should install when accepted: {bashrc_content}"+ );++ // Snapshot the output+ let settings = setup_snapshot_settings(&repo);+ settings.bind(|| {+ assert_snapshot!("prompt_accept", normalized);+ });+ }++ /// Test: User requests preview with ? then declines+ #[rstest]+ fn test_user_requests_preview_then_declines(repo: TestRepo) {+ // Create isolated HOME with empty shell config+ let temp_home = TempDir::new().unwrap();+ let bashrc = temp_home.path().join(".bashrc");+ fs::write(&bashrc, "# empty bashrc\n").unwrap();++ let mut env_vars = repo.test_env_vars();+ env_vars.retain(|(k, _)| k != "WORKTRUNK_DIRECTIVE_FILE");+ // Set SHELL to bash since we're testing with .bashrc+ env_vars.push(("SHELL".to_string(), "/bin/bash".to_string()));++ let (output, exit_code) = exec_in_pty_with_input(+ get_cargo_bin("wt").to_str().unwrap(),+ &["switch", "--create", "feature"],+ repo.root_path(),+ &env_vars,+ Some(temp_home.path()),+ "?\nn\n", // User requests preview, then declines+ );++ assert_eq!(exit_code, 0, "Switch should succeed");++ let normalized = normalize_output(&output, temp_home.path());++ // Should contain the prompt (shown twice - before and after preview)+ assert!(+ normalized.contains("Install shell integration"),+ "Should show prompt: {normalized}"+ );++ // Should show preview content (gutter with config line)+ assert!(+ normalized.contains("Will add") && normalized.contains("bash"),+ "Should show preview: {normalized}"+ );++ // Should show the config line in preview+ assert!(+ normalized.contains("eval") && normalized.contains("wt config shell init"),+ "Should show config line in preview: {normalized}"+ );++ // Shell config should NOT have the integration line (user declined)+ let bashrc_content = fs::read_to_string(&bashrc).unwrap();+ assert!(+ !bashrc_content.contains("eval \"$(command wt"),+ "Should not install when declined after preview: {bashrc_content}"+ );++ // Snapshot the output+ let settings = setup_snapshot_settings(&repo);+ settings.bind(|| {+ assert_snapshot!("prompt_preview_decline", normalized);+ });+ }++ /// Test: Second switch after first prompt → no prompt+ #[rstest]+ fn test_no_prompt_after_first_prompt(repo: TestRepo) {+ // Create isolated HOME with empty shell config+ let temp_home = TempDir::new().unwrap();+ let bashrc = temp_home.path().join(".bashrc");+ fs::write(&bashrc, "# empty bashrc\n").unwrap();++ let mut env_vars = repo.test_env_vars();+ env_vars.retain(|(k, _)| k != "WORKTRUNK_DIRECTIVE_FILE");+ // Set SHELL to bash since we're testing with .bashrc+ env_vars.push(("SHELL".to_string(), "/bin/bash".to_string()));++ // First switch - decline the prompt+ let (_, _) = exec_in_pty_with_input(+ get_cargo_bin("wt").to_str().unwrap(),+ &["switch", "--create", "feature1"],+ repo.root_path(),+ &env_vars,+ Some(temp_home.path()),+ "n\n",+ );++ // Second switch - should NOT prompt again+ let (output, exit_code) = exec_in_pty_with_input(+ get_cargo_bin("wt").to_str().unwrap(),+ &["switch", "--create", "feature2"],+ repo.root_path(),+ &env_vars,+ Some(temp_home.path()),+ "", // No input needed+ );++ assert_eq!(exit_code, 0, "Second switch should succeed");++ assert!(+ !output.contains("Install shell integration"),+ "Should not prompt on second switch: {output}"+ );+ }+}diff --git a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_accept.snap b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_accept.snapindex 4b2f17eb8..abd592274 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_accept.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_accept.snap@@ -12,5 +12,5 @@ y[36m◎[39m [36mRunning post-create project hook:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'test command'[0m[2m[0m[0mtest command-[32m✓[39m [32mCreated new worktree for [1mtest-approve[22m from [1mmain[22m @ [1m_REPO_/repo.test-approve[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[32m✓[39m [32mCreated new worktree for [1mtest-approve[22m from [1mmain[22m @ [1m_REPO_/repo.BRANCH[22m[39m+[2m↳[22m [2mRestart shell to activate shell integration[22mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_decline.snap b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_decline.snapindex 4e7e15bd3..d39ac1ddc 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_decline.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_decline.snap@@ -10,5 +10,5 @@ n[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'test command'[0m[2m[0m[36m❯[39m Allow and remember? [1m[y/N][22m[2m○[22m Commands declined, continuing worktree creation-[32m✓[39m [32mCreated new worktree for [1mtest-decline[22m from [1mmain[22m @ [1m_REPO_/repo.test-decline[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[32m✓[39m [32mCreated new worktree for [1mtest-decline[22m from [1mmain[22m @ [1m_REPO_/repo.BRANCH[22m[39m+[2m↳[22m [2mRestart shell to activate shell integration[22mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_accept.snap b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_accept.snapindex 02c52c490..334409fd5 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_accept.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_accept.snap@@ -20,5 +20,5 @@ y[36m◎[39m [36mRunning post-create [1mproject:third[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Third command'[0m[2m[0m[0mThird command-[32m✓[39m [32mCreated new worktree for [1mtest-mixed-accept[22m from [1mmain[22m @ [1m_REPO_/repo.test-mixed-accept[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[32m✓[39m [32mCreated new worktree for [1mtest-mixed-accept[22m from [1mmain[22m @ [1m_REPO_/repo.BRANCH[22m[39m+[2m↳[22m [2mRestart shell to activate shell integration[22mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_decline.snap b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_decline.snapindex cf4d99ca5..c2fa6de32 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_decline.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_mixed_approved_unapproved_decline.snap@@ -12,5 +12,5 @@ n[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Third command'[0m[2m[0m[36m❯[39m Allow and remember? [1m[y/N][22m[2m○[22m Commands declined, continuing worktree creation-[32m✓[39m [32mCreated new worktree for [1mtest-mixed-decline[22m from [1mmain[22m @ [1m_REPO_/repo.test-mixed-decline[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[32m✓[39m [32mCreated new worktree for [1mtest-mixed-decline[22m from [1mmain[22m @ [1m_REPO_/repo.BRANCH[22m[39m+[2m↳[22m [2mRestart shell to activate shell integration[22mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_multiple_commands.snap b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_multiple_commands.snapindex 1d0a90027..c43d70441 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_multiple_commands.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_multiple_commands.snap@@ -22,5 +22,5 @@ y[36m◎[39m [36mRunning post-create [1mproject:third[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Third command'[0m[2m[0m[0mThird command-[32m✓[39m [32mCreated new worktree for [1mtest-multi[22m from [1mmain[22m @ [1m_REPO_/repo.test-multi[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[32m✓[39m [32mCreated new worktree for [1mtest-multi[22m from [1mmain[22m @ [1m_REPO_/repo.BRANCH[22m[39m+[2m↳[22m [2mRestart shell to activate shell integration[22mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_named_commands.snap b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_named_commands.snapindex ea79c7790..b6ab66f1d 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_named_commands.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_named_commands.snap@@ -22,5 +22,5 @@ y[36m◎[39m [36mRunning post-create [1mproject:test[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Running tests...'[0m[2m[0m[0mRunning tests...-[32m✓[39m [32mCreated new worktree for [1mtest-named[22m from [1mmain[22m @ [1m_REPO_/repo.test-named[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[32m✓[39m [32mCreated new worktree for [1mtest-named[22m from [1mmain[22m @ [1m_REPO_/repo.BRANCH[22m[39m+[2m↳[22m [2mRestart shell to activate shell integration[22mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_permission_error.snap b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_permission_error.snapindex fc5557c75..7e20bff98 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_permission_error.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_permission_error.snap@@ -14,5 +14,5 @@ y[36m◎[39m [36mRunning post-create project hook:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'test command'[0m[2m[0m[0mtest command-[32m✓[39m [32mCreated new worktree for [1mtest-permission[22m from [1mmain[22m @ [1m_REPO_/repo.test-permission[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[32m✓[39m [32mCreated new worktree for [1mtest-permission[22m from [1mmain[22m @ [1m_REPO_/repo.BRANCH[22m[39m+[2m↳[22m [2mRestart shell to activate shell integration[22mdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__configure_shell__pty_tests__install_preview_declined.snap b/tests/integration_tests/snapshots/integration__integration_tests__configure_shell__pty_tests__install_preview_declined.snapindex dbe477b83..7edea3f09 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__configure_shell__pty_tests__install_preview_declined.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__configure_shell__pty_tests__install_preview_declined.snap@@ -4,8 +4,5 @@ expression: normalized---n-○ Will add shell extension & completions for zsh @ ~/.zshrc- if command -v wt >/dev/null 2>&1; then eval "$(command wt config shell init zsh)"; fi--❯ Proceed? [y/N]+[36m❯[39m Install shell integration? [1m[y/N/?][22m✗ Cancelled by userdiff --git a/tests/integration_tests/snapshots/integration__integration_tests__configure_shell__pty_tests__install_preview_with_gutter.snap b/tests/integration_tests/snapshots/integration__integration_tests__configure_shell__pty_tests__install_preview_with_gutter.snapindex 06dd4628c..a0befd3b0 100644--- a/tests/integration_tests/snapshots/integration__integration_tests__configure_shell__pty_tests__install_preview_with_gutter.snap+++ b/tests/integration_tests/snapshots/integration__integration_tests__configure_shell__pty_tests__install_preview_with_gutter.snap@@ -4,10 +4,7 @@ expression: normalized---y-○ Will add shell extension & completions for zsh @ ~/.zshrc- if command -v wt >/dev/null 2>&1; then eval "$(command wt config shell init zsh)"; fi--❯ Proceed? [y/N]+[36m❯[39m Install shell integration? [1m[y/N/?][22m✓ Added shell extension & completions for zsh @ ~/.zshrc↳ Skipped bash; ~/.bashrc not found↳ Skipped fish; ~/.config/fish/conf.d not founddiff --git a/tests/integration_tests/switch.rs b/tests/integration_tests/switch.rsindex 8cd3ed315..5e0fc2f66 100644--- a/tests/integration_tests/switch.rs+++ b/tests/integration_tests/switch.rs@@ -11,15 +11,19 @@ use tempfile::TempDir;// Snapshot helpersfn snapshot_switch(test_name: &str, repo: &TestRepo, args: &[&str]) {- snapshot_switch_impl(test_name, repo, args, false, None);+ snapshot_switch_impl(test_name, repo, args, false, None, None);}fn snapshot_switch_with_directive_file(test_name: &str, repo: &TestRepo, args: &[&str]) {- snapshot_switch_impl(test_name, repo, args, true, None);+ snapshot_switch_impl(test_name, repo, args, true, None, None);}fn snapshot_switch_from_dir(test_name: &str, repo: &TestRepo, args: &[&str], cwd: &Path) {- snapshot_switch_impl(test_name, repo, args, false, Some(cwd));+ snapshot_switch_impl(test_name, repo, args, false, Some(cwd), None);+}++fn snapshot_switch_with_shell(test_name: &str, repo: &TestRepo, args: &[&str], shell: &str) {+ snapshot_switch_impl(test_name, repo, args, false, None, Some(shell));}fn snapshot_switch_impl(@@ -28,6 +32,7 @@ fn snapshot_switch_impl(args: &[&str],with_directive_file: bool,cwd: Option<&Path>,+ shell: Option<&str>,) {let settings = setup_snapshot_settings(repo);settings.bind(|| {@@ -42,6 +47,9 @@ fn snapshot_switch_impl(if let Some((ref directive_path, ref _guard)) = maybe_directive {configure_directive_file(&mut cmd, directive_path);}+ if let Some(shell_path) = shell {+ cmd.env("SHELL", shell_path);+ }assert_cmd_snapshot!(test_name, cmd);});}@@ -114,10 +122,12 @@ fn test_switch_existing_with_shell_integration_configured(mut repo: TestRepo) {// Switch to existing worktree - should show warning about binary invoked directly// (different from "no shell integration" warning when shell is not configured at all)- snapshot_switch(+ // Note: Must set SHELL=/bin/zsh so scan_shell_configs() looks for .zshrc+ snapshot_switch_with_shell("switch_existing_with_shell_configured",&repo,&["shell-configured"],+ "/bin/zsh",);}diff --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 7e11e7bde..8816c8675 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -34,4 +35,4 @@ exit_code: 0[36m◎[39m [36mRunning post-create project hook:[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 new worktree for [1mtest-approved[22m from [1mmain[22m @ [1m_REPO_.test-approved[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 5b0658080..053dc7793 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@@ -25,6 +25,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -36,4 +37,4 @@ exit_code: 0[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'test command'[0m[2m[0mtest command[32m✓[39m [32mCreated new worktree for [1mtest-yes-tty[22m from [1mmain[22m @ [1m_REPO_.test-yes-tty[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 dd85dd529..d16383283 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@@ -25,6 +25,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -35,4 +36,4 @@ exit_code: 0[36m◎[39m [36mRunning post-create project hook:[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 new worktree for [1mtest-yes[22m from [1mmain[22m @ [1m_REPO_.test-yes[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__help__help_page_merge.snap b/tests/snapshots/integration__integration_tests__help__help_page_merge.snapindex f9691f38a..e3e690ec7 100644--- a/tests/snapshots/integration__integration_tests__help__help_page_merge.snap+++ b/tests/snapshots/integration__integration_tests__help__help_page_merge.snap@@ -12,6 +12,7 @@ info:RUST_LOG: warnSOURCE_DATE_EPOCH: "1735776000"WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"---success: trueexit_code: 0diff --git a/tests/snapshots/integration__integration_tests__merge__readme_example_hooks_post_create.snap b/tests/snapshots/integration__integration_tests__merge__readme_example_hooks_post_create.snapindex 4a04bae49..74e4479e8 100644--- a/tests/snapshots/integration__integration_tests__merge__readme_example_hooks_post_create.snap+++ b/tests/snapshots/integration__integration_tests__merge__readme_example_hooks_post_create.snap@@ -25,6 +25,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -38,6 +39,6 @@ exit_code: 0Resolved 24 packages in 145msInstalled 24 packages in 1.2s[32m✓[39m [32mCreated new worktree for [1mfeature-x[22m from [1mmain[22m @ [1m_REPO_.feature-x[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[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__merge__readme_example_simple_switch.snap b/tests/snapshots/integration__integration_tests__merge__readme_example_simple_switch.snapindex 356e85615..121ad62c9 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -32,4 +33,4 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1mfix-auth[22m from [1mmain[22m @ [1m_REPO_.fix-auth[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 25d0354a7..3084e5362 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -34,6 +35,6 @@ exit_code: 0[36m◎[39m [36mRunning post-create project hook:[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 new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m[36m◎[39m [36mRunning post-start [1mproject:server[22m:[39m[107m [0m [2m[0m[2m[34msleep[0m[2m 0.05 [0m[2m[36m&&[0m[2m [0m[2m[34mecho[0m[2m [0m[2m[32m'Server running'[0m[2m [0m[2m[36m>[0m[2m server.txtdiff --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 0957e1448..036d01a63 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@@ -26,6 +26,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -34,6 +35,7 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m[36m◎[39m [36mRunning post-start project hook:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Background task'[0m[2m [0m[2m[36m>[0m[2m background.txt[36m◎[39m [36mExecuting (--execute):[39mdiff --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 ae8834aa9..9c7b5dee8 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@@ -25,6 +25,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -35,4 +36,4 @@ exit_code: 0[36m◎[39m [36mRunning post-create project hook:[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 new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 acd811c19..da201813f 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -35,4 +36,4 @@ exit_code: 0[107m [0m [2m[0m[2m[34mexit[0m[2m 1[0m[33m▲[39m [33mCommand failed: exit status: 1[39m[32m✓[39m [32mCreated new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 f4d8618ed..f9bb8cc93 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@@ -25,6 +25,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -41,4 +42,4 @@ exit_code: 0[0m[36m◎[39m [36mRunning post-create [1mproject:worktree_name[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 new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 a8c4ba6d6..a8ededd2c 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -38,4 +39,4 @@ exit_code: 0[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 new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 012035cb4..4893dcaab 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -38,4 +39,4 @@ exit_code: 0[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Running setup'[0m[2m[0mRunning setup[32m✓[39m [32mCreated new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 f7275e522..9ac8f5956 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -32,4 +33,4 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 35b8d2fa5..f9fa2602e 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -35,4 +36,4 @@ exit_code: 0[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Setup complete'[0m[2m[0mSetup complete[32m✓[39m [32mCreated new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 8342d65e6..b2e785d02 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -42,4 +43,4 @@ exit_code: 0[0m[36m◎[39m [36mRunning post-create [1mproject:root[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 new worktree for [1mfeature/test[22m from [1mmain[22m @ [1m_REPO_.feature-test[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 ac9f0380a..4a2c740ae 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@@ -25,6 +25,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -35,4 +36,4 @@ exit_code: 0[36m◎[39m [36mRunning post-create project hook:[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 new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 723814aa3..12fd7d8fe 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -32,7 +33,7 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m[36m◎[39m [36mRunning post-start project hook:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m 'line1[107m [0m [2m[0m[2m[34mline2[0m[2mdiff --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 7b684e895..97c786649 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -32,6 +33,6 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m[36m◎[39m [36mRunning post-start project hook:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'POST-START-RAN'[0m[2m [0m[2m[36m>[0m[2m post_start_marker.txtdiff --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 c793220a5..082e20ca1 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -32,6 +33,6 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m[36m◎[39m [36mRunning post-start project hook:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m 'unclosed quotediff --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 dec6e186f..831831884 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -32,6 +33,6 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m[36m◎[39m [36mRunning post-start project hook:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'stdout output'[0m[2m [0m[2m[36m&&[0m[2m [0m[2m[34mecho[0m[2m [0m[2m[32m'stderr output'[0m[2m >&2diff --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 3c1cfb472..68ba09a92 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -32,7 +33,7 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m[36m◎[39m [36mRunning post-start project hook:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'first line'[0m[2m [0m[2m[36m>[0m[2m multiline.txt[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'second line'[0m[2m [0m[2m[36m>>[0m[2m multiline.txtdiff --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 22cd57516..2c883bffd 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -32,7 +33,7 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m[36m◎[39m [36mRunning post-start [1mproject:task1[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Task 1 running'[0m[2m [0m[2m[36m>[0m[2m task1.txt[36m◎[39m [36mRunning post-start [1mproject:task2[22m:[39mdiff --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 184548a9a..0a784835e 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -32,7 +33,7 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m[36m◎[39m [36mRunning post-start [1mproject:task1[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'TASK1_OUTPUT'[0m[2m[36m◎[39m [36mRunning post-start [1mproject:task2[22m:[39mdiff --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 995f439b7..11d0ca52a 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -32,6 +33,6 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m[36m◎[39m [36mRunning post-start project hook:[39m[107m [0m [2m[0m[2m[34msleep[0m[2m 0.1 [0m[2m[36m&&[0m[2m [0m[2m[34mecho[0m[2m [0m[2m[32m'Background task done'[0m[2m [0m[2m[36m>[0m[2m background.txtdiff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_skip_existing.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_skip_existing.snapindex 4ae917d78..86b4a6fbb 100644--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_skip_existing.snap+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_skip_existing.snap@@ -23,6 +23,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -31,4 +32,4 @@ exit_code: 0----- stderr -----[33m▲[39m [33mWorktree for [1mfeature[22m @ [1m_REPO_.feature[22m, but cannot change directory — shell integration not installed[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --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.snapnew file mode 100644index 000000000..317bba710--- /dev/null+++ b/tests/snapshots/integration__integration_tests__shell_integration_prompt__pty_tests__prompt_accept.snap@@ -0,0 +1,15 @@+---+source: tests/integration_tests/shell_integration_prompt.rs+expression: normalized+---+y++[32m✓[39m [32mCreated new worktree for [1mfeature[22m from [1mmain[22m @ [1m[REPO]/repo.feature[22m[39m++[36m❯[39m Install shell integration? [1m[y/N/?][22m+[32m✓[39m [32mAdded shell extension & completions for [1mbash[22m @ [1m~/.bashrc[22m[39m+[2m↳[22m [2mSkipped [90mzsh[39m; [90m~/.zshrc[39m not found[22m+[2m↳[22m [2mSkipped [90mfish[39m; [90m~/.config/fish/conf.d[39m not found[22m++[32m✓[39m [32mConfigured 1 shell[39m+[2m↳[22m [2mRestart shell or run: [90msource ~/.bashrc[39m[22mdiff --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.snapnew file mode 100644index 000000000..b93396431--- /dev/null+++ b/tests/snapshots/integration__integration_tests__shell_integration_prompt__pty_tests__prompt_decline.snap@@ -0,0 +1,10 @@+---+source: tests/integration_tests/shell_integration_prompt.rs+expression: normalized+---+n++[32m✓[39m [32mCreated new worktree for [1mfeature[22m from [1mmain[22m @ [1m[REPO]/repo.feature[22m[39m++[36m❯[39m Install shell integration? [1m[y/N/?][22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --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.snapnew file mode 100644index 000000000..2a1d0dc02--- /dev/null+++ b/tests/snapshots/integration__integration_tests__shell_integration_prompt__pty_tests__prompt_preview_decline.snap@@ -0,0 +1,15 @@+---+source: tests/integration_tests/shell_integration_prompt.rs+expression: normalized+---+?+n++[32m✓[39m [32mCreated new worktree for [1mfeature[22m from [1mmain[22m @ [1m[REPO]/repo.feature[22m[39m++[36m❯[39m Install shell integration? [1m[y/N/?][22m+[2m○[22m Will add shell extension & completions for [1mbash[0m @ [1m~/.bashrc+[107m [0m [2m[0m[2m[35mif[0m[2m [0m[2m[34mcommand[0m[2m [0m[2m[36m-v[0m[2m wt [0m[2m[36m>[0m[2m/dev/null [0m[2m[33m2[0m[2m>&1; [0m[2m[35mthen[0m[2m [0m[2m[34meval[0m[2m [0m[2m[32m"$([0m[2m[34mcommand[0m[2m wt config shell init bash)"[0m[2m; [0m[2m[35mfi[0m[2m++[36m❯[39m Install shell integration? [1m[y/N/?][22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --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 eac790ae4..1d23e3b57 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@@ -26,6 +26,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -34,4 +35,4 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1mnew-feature[22m from [1mmain[22m @ [1m_REPO_.new-feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__ping_pong_1_main_to_feature_a.snap b/tests/snapshots/integration__integration_tests__switch__ping_pong_1_main_to_feature_a.snapindex 9b87b462c..04d1268c5 100644--- a/tests/snapshots/integration__integration_tests__switch__ping_pong_1_main_to_feature_a.snap+++ b/tests/snapshots/integration__integration_tests__switch__ping_pong_1_main_to_feature_a.snap@@ -23,6 +23,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -31,4 +32,4 @@ exit_code: 0----- stderr -----[32m✓[39m [32mSwitched to worktree for [1mfeature-a[22m @ [1m_REPO_.feature-a[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__ping_pong_2_feature_a_to_main.snap b/tests/snapshots/integration__integration_tests__switch__ping_pong_2_feature_a_to_main.snapindex c2759bf33..5f8c5ed14 100644--- a/tests/snapshots/integration__integration_tests__switch__ping_pong_2_feature_a_to_main.snap+++ b/tests/snapshots/integration__integration_tests__switch__ping_pong_2_feature_a_to_main.snap@@ -23,6 +23,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -31,4 +32,4 @@ exit_code: 0----- stderr -----[33m▲[39m [33mWorktree for [1mmain[22m @ [1m_REPO_[22m, but cannot change directory — shell integration not installed[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__ping_pong_3_dash_to_feature_a.snap b/tests/snapshots/integration__integration_tests__switch__ping_pong_3_dash_to_feature_a.snapindex 42cde3c7f..de14364f0 100644--- a/tests/snapshots/integration__integration_tests__switch__ping_pong_3_dash_to_feature_a.snap+++ b/tests/snapshots/integration__integration_tests__switch__ping_pong_3_dash_to_feature_a.snap@@ -23,6 +23,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -31,4 +32,4 @@ exit_code: 0----- stderr -----[33m▲[39m [33mWorktree for [1mfeature-a[22m @ [1m_REPO_.feature-a[22m, but cannot change directory — shell integration not installed[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__ping_pong_4_dash_to_main.snap b/tests/snapshots/integration__integration_tests__switch__ping_pong_4_dash_to_main.snapindex 6ba02d4a7..f413b12ef 100644--- a/tests/snapshots/integration__integration_tests__switch__ping_pong_4_dash_to_main.snap+++ b/tests/snapshots/integration__integration_tests__switch__ping_pong_4_dash_to_main.snap@@ -23,6 +23,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -31,4 +32,4 @@ exit_code: 0----- stderr -----[33m▲[39m [33mWorktree for [1mmain[22m @ [1m_REPO_[22m, but cannot change directory — shell integration not installed[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__ping_pong_5_dash_to_feature_a_again.snap b/tests/snapshots/integration__integration_tests__switch__ping_pong_5_dash_to_feature_a_again.snapindex 42cde3c7f..de14364f0 100644--- a/tests/snapshots/integration__integration_tests__switch__ping_pong_5_dash_to_feature_a_again.snap+++ b/tests/snapshots/integration__integration_tests__switch__ping_pong_5_dash_to_feature_a_again.snap@@ -23,6 +23,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -31,4 +32,4 @@ exit_code: 0----- stderr -----[33m▲[39m [33mWorktree for [1mfeature-a[22m @ [1m_REPO_.feature-a[22m, but cannot change directory — shell integration not installed[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_base_without_create.snap b/tests/snapshots/integration__integration_tests__switch__switch_base_without_create.snapindex a27fb282d..7f7c37f4c 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_base_without_create.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_base_without_create.snap@@ -25,6 +25,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -34,3 +35,4 @@ exit_code: 0----- stderr -----[33m▲[39m [33m--base flag is only used with --create, ignoring[39m[2m○[22m Already on worktree for [1mmain[22m @ [1m_REPO_[22m+[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 2811d8822..dd3e01e2e 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@@ -25,6 +25,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -34,4 +35,4 @@ exit_code: 0----- stderr -----[33m▲[39m [33mMoving [1m_REPO_.clobber-ext.txt[22m to [1m_REPO_.clobber-ext.txt.bak.20250102-000000[22m ([90m--clobber[39m)[39m[32m✓[39m [32mCreated new worktree for [1mclobber-ext.txt[22m from [1mmain[22m @ [1m_REPO_.clobber-ext.txt[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 e899ff1ec..e57a2c9e3 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@@ -25,6 +25,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -34,4 +35,4 @@ exit_code: 0----- stderr -----[33m▲[39m [33mMoving [1m_REPO_.clobber-dir-test[22m to [1m_REPO_.clobber-dir-test.bak.20250102-000000[22m ([90m--clobber[39m)[39m[32m✓[39m [32mCreated new worktree for [1mclobber-dir-test[22m from [1mmain[22m @ [1m_REPO_.clobber-dir-test[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 9aca47923..039e5ced0 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@@ -25,6 +25,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -34,4 +35,4 @@ exit_code: 0----- stderr -----[33m▲[39m [33mMoving [1m_REPO_.clobber-file-test[22m to [1m_REPO_.clobber-file-test.bak.20250102-000000[22m ([90m--clobber[39m)[39m[32m✓[39m [32mCreated new worktree for [1mclobber-file-test[22m from [1mmain[22m @ [1m_REPO_.clobber-file-test[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 8d9703e86..94da013e6 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_create_new.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_create_new.snap@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -32,4 +33,4 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1mfeature-x[22m from [1mmain[22m @ [1m_REPO_.feature-x[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 b59c6ad34..443fa44e3 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -32,4 +33,4 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 a4ebfc611..110b0077f 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -34,4 +35,4 @@ exit_code: 0[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 [90m--create[39m; run [90mwt switch remote-feature[39m[22m[32m✓[39m [32mCreated new worktree for [1mremote-feature[22m from [1mmain[22m @ [1m_REPO_.remote-feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --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 7a5523b58..e4079ab15 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@@ -26,6 +26,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -34,5 +35,6 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1mfile-test[22m from [1mmain[22m @ [1m_REPO_.file-test[22m[39m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m[36m◎[39m [36mExecuting (--execute):[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'test content'[0m[2m [0m[2m[36m>[0m[2m test.txtdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_existing.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_existing.snapindex 4b4ce34cd..4125c2da4 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_existing.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_existing.snap@@ -25,6 +25,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -33,5 +34,6 @@ exit_code: 0----- stderr -----[2m○[22m Switched to worktree for [1mexisting-exec[22m @ [1m_REPO_.existing-exec[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m[36m◎[39m [36mExecuting (--execute):[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'existing worktree'[0m[2m [0m[2m[36m>[0m[2m existing.txtdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_failure.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_failure.snapindex 0796b7804..89cec192d 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_failure.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_failure.snap@@ -26,6 +26,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: false@@ -34,5 +35,6 @@ exit_code: 1----- stderr -----[32m✓[39m [32mCreated new worktree for [1mfail-test[22m from [1mmain[22m @ [1m_REPO_.fail-test[22m[39m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m[36m◎[39m [36mExecuting (--execute):[39m[107m [0m [2m[0m[2m[34mexit[0m[2m 1diff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_multiline.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_multiline.snapindex af868ee0d..582c0053f 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_multiline.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_multiline.snap@@ -26,6 +26,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -37,6 +38,7 @@ line3----- stderr -----[32m✓[39m [32mCreated new worktree for [1mmultiline-test[22m from [1mmain[22m @ [1m_REPO_.multiline-test[22m[39m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m[36m◎[39m [36mExecuting (--execute):[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'line1'[0m[2m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'line2'[0m[2mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_execute_success.snap b/tests/snapshots/integration__integration_tests__switch__switch_execute_success.snapindex 8c4752e0d..0bdd90a47 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_execute_success.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_execute_success.snap@@ -26,6 +26,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -35,5 +36,6 @@ test output----- stderr -----[32m✓[39m [32mCreated new worktree for [1mexec-test[22m from [1mmain[22m @ [1m_REPO_.exec-test[22m[39m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m[36m◎[39m [36mExecuting (--execute):[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'test output'[0m[2mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_existing_branch.snap b/tests/snapshots/integration__integration_tests__switch__switch_existing_branch.snapindex 350ac3635..ebc37af85 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_existing_branch.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_existing_branch.snap@@ -23,6 +23,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -31,4 +32,4 @@ exit_code: 0----- stderr -----[33m▲[39m [33mWorktree for [1mfeature-z[22m @ [1m_REPO_.feature-z[22m, but cannot change directory — shell integration not installed[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --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.snapindex d4f6f724d..5542c4143 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@@ -31,3 +31,4 @@ exit_code: 0----- stderr -----[33m▲[39m [33mWorktree for [1mshell-configured[22m @ [1m_REPO_.shell-configured[22m, but cannot change directory — restart the shell to activate[39m+[2m↳[22m [2mRestart shell to activate shell integration[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_main_branch.snap b/tests/snapshots/integration__integration_tests__switch__switch_main_branch.snapindex 13091ab33..926576401 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_main_branch.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_main_branch.snap@@ -23,6 +23,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -31,3 +32,4 @@ exit_code: 0----- stderr -----[2m○[22m Already on worktree for [1mmain[22m @ [1m_REPO_[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_main_branch_to_feature.snap b/tests/snapshots/integration__integration_tests__switch__switch_main_branch_to_feature.snapindex 9b87b462c..04d1268c5 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_main_branch_to_feature.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_main_branch_to_feature.snap@@ -23,6 +23,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -31,4 +32,4 @@ exit_code: 0----- stderr -----[32m✓[39m [32mSwitched to worktree for [1mfeature-a[22m @ [1m_REPO_.feature-a[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --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 5b0534b03..169f33647 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@@ -27,6 +27,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -36,5 +37,6 @@ execute command runs----- stderr -----[32m✓[39m [32mCreated new worktree for [1mno-hooks-test[22m from [1mmain[22m @ [1m_REPO_.no-hooks-test[22m[39m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m[36m◎[39m [36mExecuting (--execute):[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'execute command runs'[0m[2mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_existing.snap b/tests/snapshots/integration__integration_tests__switch__switch_no_hooks_existing.snapindex 1a8e0542c..350fab691 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@@ -26,6 +26,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -35,5 +36,6 @@ execute still runs----- stderr -----[2m○[22m Switched to worktree for [1mexisting-no-hooks[22m @ [1m_REPO_.existing-no-hooks[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m[36m◎[39m [36mExecuting (--execute):[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'execute still runs'[0m[2mdiff --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 3284ddb69..aed3b4b08 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@@ -25,6 +25,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -33,4 +34,4 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1mno-post-start[22m from [1mmain[22m @ [1m_REPO_.no-post-start[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 0c01f5bcd..7521d18f6 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@@ -26,6 +26,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -34,4 +35,4 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1myes-no-hooks[22m from [1mmain[22m @ [1m_REPO_.yes-no-hooks[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 84e547e22..211cdc124 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -32,4 +33,4 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1mfeature-from-main[22m from [1mmain[22m @ [1m_REPO_.feature-from-main[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_stale_history_first_dash.snap b/tests/snapshots/integration__integration_tests__switch__switch_stale_history_first_dash.snapindex b46e251e4..7a6843e26 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_stale_history_first_dash.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_stale_history_first_dash.snap@@ -23,6 +23,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -31,4 +32,4 @@ exit_code: 0----- stderr -----[33m▲[39m [33mWorktree for [1mbranch-a[22m @ [1m_REPO_.branch-a[22m, but cannot change directory — shell integration not installed[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_stale_history_second_dash.snap b/tests/snapshots/integration__integration_tests__switch__switch_stale_history_second_dash.snapindex 70e32746e..383739fc2 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_stale_history_second_dash.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_stale_history_second_dash.snap@@ -23,6 +23,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -31,3 +32,4 @@ exit_code: 0----- stderr -----[2m○[22m Already on worktree for [1mmain[22m @ [1m_REPO_[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_stale_history_to_a.snap b/tests/snapshots/integration__integration_tests__switch__switch_stale_history_to_a.snapindex 5f3090f40..7ac6b65f3 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_stale_history_to_a.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_stale_history_to_a.snap@@ -23,6 +23,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -31,4 +32,4 @@ exit_code: 0----- stderr -----[32m✓[39m [32mSwitched to worktree for [1mbranch-a[22m @ [1m_REPO_.branch-a[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_stale_history_to_b.snap b/tests/snapshots/integration__integration_tests__switch__switch_stale_history_to_b.snapindex 3c9dd6868..ea45a8209 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_stale_history_to_b.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_stale_history_to_b.snap@@ -23,6 +23,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -31,4 +32,4 @@ exit_code: 0----- stderr -----[32m✓[39m [32mSwitched to worktree for [1mbranch-b[22m @ [1m_REPO_.branch-b[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22mdiff --git a/tests/snapshots/integration__integration_tests__switch__switch_to_existing_primary_on_different_branch.snap b/tests/snapshots/integration__integration_tests__switch__switch_to_existing_primary_on_different_branch.snapindex 7de09fe8a..daa146dcf 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_to_existing_primary_on_different_branch.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_to_existing_primary_on_different_branch.snap@@ -23,6 +23,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -31,4 +32,4 @@ exit_code: 0----- stderr -----[33m▲[39m [33mWorktree for [1mexisting-branch[22m @ [1m_REPO_.existing-branch[22m, but cannot change directory — shell integration not installed[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 326e55159..4e658170d 100644--- a/tests/snapshots/integration__integration_tests__switch__switch_with_base.snap+++ b/tests/snapshots/integration__integration_tests__switch__switch_with_base.snap@@ -26,6 +26,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -34,4 +35,4 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1mfeature-with-base[22m from [1mmain[22m @ [1m_REPO_.feature-with-base[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 a6966a57e..9cc97e2e9 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@@ -25,6 +25,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -33,4 +34,4 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 ef167b9a6..8c1a59297 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -32,7 +33,7 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m[36m◎[39m [36mRunning post-start [1muser:bg[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'USER_POST_START'[0m[2m [0m[2m[36m>[0m[2m user_bg.txt[36m◎[39m [36mRunning post-start project hook:[39mdiff --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 c7b2fb305..34fa76bb1 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -34,4 +35,4 @@ exit_code: 0[36m◎[39m [36mRunning post-create [1muser:vars[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 new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 c866c583c..3af22899d 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -36,4 +37,4 @@ exit_code: 0[0m[36m◎[39m [36mRunning post-create project hook:[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 new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 04399e445..dc24d18be 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -34,4 +35,4 @@ exit_code: 0[36m◎[39m [36mRunning post-create [1muser:setup[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 new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 6a8e01aed..14e37a6d5 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -34,4 +35,4 @@ exit_code: 0[36m◎[39m [36mRunning post-create [1muser:log[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 new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 2c4e3d4e7..d158a4d39 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -35,4 +36,4 @@ exit_code: 0[107m [0m [2m[0m[2m[34mexit[0m[2m 1[0m[33m▲[39m [33mCommand [1mfailing[22m failed: exit status: 1[39m[32m✓[39m [32mCreated new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[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 5f2fdd262..14acb302c 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@@ -24,6 +24,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -32,6 +33,6 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m[36m◎[39m [36mRunning post-start [1muser:bg[22m:[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'USER_POST_START_RAN'[0m[2m [0m[2m[36m>[0m[2m user_bg_marker.txtdiff --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 a6966a57e..9cc97e2e9 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@@ -25,6 +25,7 @@ info:SOURCE_DATE_EPOCH: "1735776000"USERPROFILE: "[TEST_HOME]"WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"---success: true@@ -33,4 +34,4 @@ exit_code: 0----- stderr -----[32m✓[39m [32mCreated new worktree for [1mfeature[22m from [1mmain[22m @ [1m_REPO_.feature[22m[39m-[2m↳[22m [2mRun [90mwt config shell install[39m to enable automatic cd[22m+[2m↳[22m [2mTo enable automatic cd, run [90mwt config shell install[39m[22m