Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove __MISE_WATCH,__MISE_DIFF env vars on mise deactivate #3178

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ chpwd_functions=( ${chpwd_functions:#_mise_hook} )
unset -f _mise_hook
unset -f mise
unset MISE_SHELL
unset __MISE_WATCH
unset __MISE_DIFF
2 changes: 2 additions & 0 deletions src/shell/bash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ impl Shell for Bash {
unset _mise_hook
unset mise
unset MISE_SHELL
unset __MISE_DIFF
unset __MISE_WATCH
"#}
}

Expand Down
2 changes: 2 additions & 0 deletions src/shell/fish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ impl Shell for Fish {
functions --erase __mise_cd_hook
functions --erase mise
set -e MISE_SHELL
set -e __MISE_DIFF
set -e __MISE_WATCH
"#}
}

Expand Down
7 changes: 6 additions & 1 deletion src/shell/nushell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ impl Shell for Nushell {
}

fn deactivate(&self) -> String {
self.unset_env("MISE_SHELL")
[
self.unset_env("MISE_SHELL"),
self.unset_env("__MISE_DIFF"),
self.unset_env("__MISE_DIFF"),
]
.join("")
}

fn set_env(&self, k: &str, v: &str) -> String {
Expand Down
2 changes: 2 additions & 0 deletions src/shell/snapshots/mise__shell__bash__tests__deactivate.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ PROMPT_COMMAND="${PROMPT_COMMAND//_mise_hook/}"
unset _mise_hook
unset mise
unset MISE_SHELL
unset __MISE_DIFF
unset __MISE_WATCH
2 changes: 2 additions & 0 deletions src/shell/snapshots/mise__shell__fish__tests__deactivate.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ functions --erase __mise_env_eval_2
functions --erase __mise_cd_hook
functions --erase mise
set -e MISE_SHELL
set -e __MISE_DIFF
set -e __MISE_WATCH
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ expression: replace_path(&deactivate)
snapshot_kind: text
---
hide,MISE_SHELL,
hide,__MISE_DIFF,
hide,__MISE_DIFF,
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ for hook_type in hooks:
del XSH.aliases['mise']
del XSH.env['MISE_SHELL']
del os.environ['MISE_SHELL']
del XSH.env['__MISE_DIFF']
del os.environ['__MISE_DIFF']
del XSH.env['__MISE_WATCH']
del os.environ['__MISE_WATCH']
2 changes: 2 additions & 0 deletions src/shell/snapshots/mise__shell__zsh__tests__deactivate.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ chpwd_functions=( ${chpwd_functions:#_mise_hook} )
unset -f _mise_hook
unset -f mise
unset MISE_SHELL
unset __MISE_WATCH
unset __MISE_DIFF
4 changes: 4 additions & 0 deletions src/shell/xonsh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ impl Shell for Xonsh {
del XSH.aliases['mise']
del XSH.env['MISE_SHELL']
del os.environ['MISE_SHELL']
del XSH.env['__MISE_DIFF']
del os.environ['__MISE_DIFF']
del XSH.env['__MISE_WATCH']
del os.environ['__MISE_WATCH']
"#}
}

Expand Down
2 changes: 2 additions & 0 deletions src/shell/zsh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ impl Shell for Zsh {
unset -f _mise_hook
unset -f mise
unset MISE_SHELL
unset __MISE_WATCH
unset __MISE_DIFF
"#}
}

Expand Down