Skip to content

Commit 9bd3351

Browse files
committed
'fix zshrc sourcing'
1 parent b521767 commit 9bd3351

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: src/exec/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub fn wrap_command(command: &str, test_mode: bool) -> String {
2525

2626
match shell_type.as_str() {
2727
"zsh" => format!(
28-
r#"emulate zsh; if [ -f ~/.zshrc ]; then . ~/.zshrc >/dev/null 2>&1; fi; {}"#,
28+
r#"setopt no_global_rcs; if [ -f ~/.zshrc ]; then ZDOTDIR=~ source ~/.zshrc; fi; {}"#,
2929
clean_command
3030
),
3131
"fish" => format!(
@@ -81,8 +81,8 @@ pub fn execute_shell_command(ctx: &ExecutionContext) -> Result<()> {
8181
if ctx.test_mode {
8282
command.args(&["-c", &wrapped_command]);
8383
} else {
84-
// Use -c for both interactive and non-interactive mode to ensure consistent behavior
85-
command.args(&["-c", &wrapped_command]);
84+
// Use -i for all shells in interactive mode to ensure proper initialization
85+
command.args(&["-i", "-c", &wrapped_command]);
8686
}
8787

8888
// Set working directory

0 commit comments

Comments
 (0)