Skip to content

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.rs
index 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):
```bash
eval "$(wt config shell init bash)"
```
diff --git a/src/shell.rs b/src/shell.rs
index 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.rs
index 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 zsh ~/.zshrc
  if command -v wt >/dev/null 2>&1; then eval "$(command wt config shell init zsh)"; fi
- πŸ’‘ bash ~/.bash_profile (not found)
+ πŸ’‘ bash ~/.bashrc (not found)
πŸ’‘ fish ~/.config/fish/conf.d (not found)
βœ… Configured 1 shell
@@ -197,7 +197,7 @@ fn test_configure_shell_no_files() {
success: false
exit_code: 1
----- stdout -----
- πŸ’‘ bash ~/.bash_profile (not found)
+ πŸ’‘ bash ~/.bashrc (not found)
πŸ’‘ zsh ~/.zshrc (not found)
πŸ’‘ fish ~/.config/fish/conf.d (not found)
❌ No shell config files found
@@ -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: true
exit_code: 0
----- stdout -----
- βœ… Added bash ~/.bash_profile
+ βœ… Added bash ~/.bashrc
  if command -v wt >/dev/null 2>&1; then eval "$(command wt config shell init bash)"; fi
βœ… Added zsh ~/.zshrc
  if command -v wt >/dev/null 2>&1; then eval "$(command wt config shell init zsh)"; fi
@@ -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: true
exit_code: 0
----- stdout -----
- βšͺ Already configured bash ~/.bash_profile
+ βšͺ Already configured bash ~/.bashrc
  if command -v wt >/dev/null 2>&1; then eval "$(command wt config shell init bash)"; fi
βœ… Added zsh ~/.zshrc
  if command -v wt >/dev/null 2>&1; then eval "$(command wt config shell init zsh)"; fi