Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
Feat: Use .bashrc for Bash shell integration
Maximilian Roosadc2f4d41edc
diff --git a/src/cli.rs b/src/cli.rsindex b6948c747..68188f8ba 100644--- a/src/cli.rs+++ b/src/cli.rs@@ -145,7 +145,7 @@ pub enum ConfigShellCommand {Add one line to your shell config:-Bash (~/.bash_profile):+Bash (~/.bashrc):```basheval "$(wt config shell init bash)"```diff --git a/src/shell.rs b/src/shell.rsindex c5d1ac6cf..6cfe4e2aa 100644--- a/src/shell.rs+++ b/src/shell.rs@@ -44,8 +44,8 @@ impl Shell {match self {Self::Bash => {- // Use .bash_profile - canonical location for login shell initialization- vec![home.join(".bash_profile")]+ // Use .bashrc - sourced by interactive shells (login shells should source .bashrc)+ vec![home.join(".bashrc")]}Self::Zsh => {let zdotdir = std::env::var("ZDOTDIR")diff --git a/tests/integration_tests/configure_shell.rs b/tests/integration_tests/configure_shell.rsindex 6958ead18..e366f6807 100644--- a/tests/integration_tests/configure_shell.rs+++ b/tests/integration_tests/configure_shell.rs@@ -30,7 +30,7 @@ fn test_configure_shell_with_yes() {----- stdout -----β Added [1mzsh[0m ~/.zshrc[107m [0m [1m[35mif[0m [1m[34mcommand[0m [36m-v[0m wt [36m>[0m/dev/null [33m2[0m>&1; [1m[35mthen[0m [1m[34meval[0m [32m"$([1m[34mcommand[0m wt config shell init zsh)"[0m; [1m[35mfi[0m[0m- π‘ [2mbash ~/.bash_profile (not found)[0m+ π‘ [2mbash ~/.bashrc (not found)[0mπ‘ [2mfish ~/.config/fish/conf.d (not found)[0mβ [32mConfigured 1 shell[0m@@ -197,7 +197,7 @@ fn test_configure_shell_no_files() {success: falseexit_code: 1----- stdout ------ π‘ [2mbash ~/.bash_profile (not found)[0m+ π‘ [2mbash ~/.bashrc (not found)[0mπ‘ [2mzsh ~/.zshrc (not found)[0mπ‘ [2mfish ~/.config/fish/conf.d (not found)[0mβ [31mNo shell config files found[0m@@ -214,7 +214,7 @@ fn test_configure_shell_multiple_configs() {let temp_home = TempDir::new().unwrap();// Create multiple shell config files- let bash_config_path = temp_home.path().join(".bash_profile");+ let bash_config_path = temp_home.path().join(".bashrc");let zshrc_path = temp_home.path().join(".zshrc");fs::write(&bash_config_path, "# Existing bash config\n").unwrap();fs::write(&zshrc_path, "# Existing zsh config\n").unwrap();@@ -234,7 +234,7 @@ fn test_configure_shell_multiple_configs() {success: trueexit_code: 0----- stdout ------ β Added [1mbash[0m ~/.bash_profile+ β Added [1mbash[0m ~/.bashrc[107m [0m [1m[35mif[0m [1m[34mcommand[0m [36m-v[0m wt [36m>[0m/dev/null [33m2[0m>&1; [1m[35mthen[0m [1m[34meval[0m [32m"$([1m[34mcommand[0m wt config shell init bash)"[0m; [1m[35mfi[0m[0mβ Added [1mzsh[0m ~/.zshrc[107m [0m [1m[35mif[0m [1m[34mcommand[0m [36m-v[0m wt [36m>[0m/dev/null [33m2[0m>&1; [1m[35mthen[0m [1m[34meval[0m [32m"$([1m[34mcommand[0m wt config shell init zsh)"[0m; [1m[35mfi[0m[0m@@ -269,7 +269,7 @@ fn test_configure_shell_mixed_states() {let temp_home = TempDir::new().unwrap();// Create bash config with wt already configured- let bash_config_path = temp_home.path().join(".bash_profile");+ let bash_config_path = temp_home.path().join(".bashrc");fs::write(&bash_config_path,"# Existing config\nif command -v wt >/dev/null 2>&1; then eval \"$(command wt config shell init bash)\"; fi\n",@@ -295,7 +295,7 @@ fn test_configure_shell_mixed_states() {success: trueexit_code: 0----- stdout ------ βͺ Already configured [1mbash[0m ~/.bash_profile+ βͺ Already configured [1mbash[0m ~/.bashrc[107m [0m [1m[35mif[0m [1m[34mcommand[0m [36m-v[0m wt [36m>[0m/dev/null [33m2[0m>&1; [1m[35mthen[0m [1m[34meval[0m [32m"$([1m[34mcommand[0m wt config shell init bash)"[0m; [1m[35mfi[0m[0mβ Added [1mzsh[0m ~/.zshrc[107m [0m [1m[35mif[0m [1m[34mcommand[0m [36m-v[0m wt [36m>[0m/dev/null [33m2[0m>&1; [1m[35mthen[0m [1m[34meval[0m [32m"$([1m[34mcommand[0m wt config shell init zsh)"[0m; [1m[35mfi[0m[0m