Skip to content

Commit

Permalink
Detect Fish via FISH_VERSION (#2781)
Browse files Browse the repository at this point in the history
## Summary

Apparently `SHELL` isn't always set to Fish:
fish-shell/fish-shell#374.

## Test Plan

`uv venv` after running `fish` in macOS.
  • Loading branch information
charliermarsh committed Apr 2, 2024
1 parent 1ac9672 commit 03b709a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/uv/src/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ impl Shell {
pub(crate) fn from_env() -> Option<Shell> {
if std::env::var_os("NU_VERSION").is_some() {
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") {
Shell::from_shell_path(env_shell)
} else if cfg!(windows) {
Expand Down

0 comments on commit 03b709a

Please sign in to comment.