mirror of
https://github.com/astral-sh/uv.git
synced 2025-09-30 22:11:12 +00:00
Detect Fish via FISH_VERSION
(#2781)
## Summary Apparently `SHELL` isn't always set to Fish: https://github.com/fish-shell/fish-shell/issues/374. ## Test Plan `uv venv` after running `fish` in macOS.
This commit is contained in:
parent
1ac9672b95
commit
03b709a0e7
1 changed files with 6 additions and 0 deletions
|
@ -33,6 +33,12 @@ impl Shell {
|
||||||
pub(crate) fn from_env() -> Option<Shell> {
|
pub(crate) fn from_env() -> Option<Shell> {
|
||||||
if std::env::var_os("NU_VERSION").is_some() {
|
if std::env::var_os("NU_VERSION").is_some() {
|
||||||
Some(Shell::Nushell)
|
Some(Shell::Nushell)
|
||||||
|
} else if std::env::var_os("FISH_VERSION").is_some() {
|
||||||
|
Some(Shell::Fish)
|
||||||
|
} else if std::env::var_os("BASH_VERSION").is_some() {
|
||||||
|
Some(Shell::Bash)
|
||||||
|
} else if std::env::var_os("ZSH_VERSION").is_some() {
|
||||||
|
Some(Shell::Zsh)
|
||||||
} else if let Some(env_shell) = std::env::var_os("SHELL") {
|
} else if let Some(env_shell) = std::env::var_os("SHELL") {
|
||||||
Shell::from_shell_path(env_shell)
|
Shell::from_shell_path(env_shell)
|
||||||
} else if cfg!(windows) {
|
} else if cfg!(windows) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue