Skip to content
Merged
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
12 changes: 12 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,19 @@ fn get_venv_path() -> PathBuf {
}

/// Auto-detect the current shell from environment.
///
/// Check order:
/// 1. `$FISH_VERSION` — set by fish itself, reliable even when $SHELL lags
/// 2. `$NU_VERSION` — set by nushell
/// 3. `$SHELL` — login shell; may differ from the running shell
/// 4. `$PSModulePath` — PowerShell
fn detect_shell() -> &'static str {
if env::var("FISH_VERSION").is_ok() {
return "fish";
}
if env::var("NU_VERSION").is_ok() {
return "nushell";
}
if let Ok(shell) = env::var("SHELL") {
if shell.contains("fish") {
return "fish";
Expand Down
Loading