mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-12-25 11:20:01 +00:00
feat(pwsh): Set STARSHIP_SHELL to pwsh on PS >5 (#3443)
* feat(pwsh): Set STARSHIP_SHELL to pwsh ON PS >5 This is needed for the custom module to use the correct shell. Closes #3376 * Update src/context.rs Co-authored-by: David Knaack <davidkna@users.noreply.github.com> Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
This commit is contained in:
parent
6aa2bab97e
commit
7e32fd952e
@ -278,7 +278,7 @@ impl<'a> Context<'a> {
|
||||
"bash" => Shell::Bash,
|
||||
"fish" => Shell::Fish,
|
||||
"ion" => Shell::Ion,
|
||||
"powershell" => Shell::PowerShell,
|
||||
"powershell" | "pwsh" => Shell::PowerShell,
|
||||
"zsh" => Shell::Zsh,
|
||||
"elvish" => Shell::Elvish,
|
||||
"tcsh" => Shell::Tcsh,
|
||||
|
@ -135,7 +135,11 @@ $null = New-Module starship {
|
||||
# Disable virtualenv prompt, it breaks starship
|
||||
$ENV:VIRTUAL_ENV_DISABLE_PROMPT=1
|
||||
|
||||
$ENV:STARSHIP_SHELL = "powershell"
|
||||
if ($PSVersionTable.PSVersion.Major -gt 5) {
|
||||
$ENV:STARSHIP_SHELL = "pwsh"
|
||||
} else {
|
||||
$ENV:STARSHIP_SHELL = "powershell"
|
||||
}
|
||||
|
||||
# Set up the session key that will be used to store logs
|
||||
$ENV:STARSHIP_SESSION_KEY = -join ((48..57) + (65..90) + (97..122) | Get-Random -Count 16 | ForEach-Object { [char]$_ })
|
||||
|
Loading…
Reference in New Issue
Block a user