mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-29 12:01:07 -08:00
parent
f6501aeb51
commit
b651c9a065
|
@ -32,14 +32,14 @@ function Set-PoshPrompt {
|
|||
$config = "$PSScriptRoot/themes/$Theme.omp.json"
|
||||
}
|
||||
elseif (Test-Path $Theme) {
|
||||
$config = Resolve-Path -Path $Theme
|
||||
$config = (Resolve-Path -Path $Theme).Path
|
||||
}
|
||||
else {
|
||||
$config = "$PSScriptRoot/themes/jandedobbeleer.omp.json"
|
||||
}
|
||||
|
||||
$poshCommand = Get-PoshCommand
|
||||
Invoke-Expression (& $poshCommand --init --shell pwsh --config $config)
|
||||
Invoke-Expression (& $poshCommand --init --shell=pwsh --config="$config")
|
||||
}
|
||||
|
||||
function Get-PoshThemes {
|
||||
|
|
|
@ -2,8 +2,9 @@ $global:PoshSettings = New-Object -TypeName PSObject -Property @{
|
|||
Theme = "";
|
||||
}
|
||||
|
||||
if (Test-Path "::CONFIG::") {
|
||||
$global:PoshSettings.Theme = Resolve-Path -Path "::CONFIG::"
|
||||
$config = "::CONFIG::"
|
||||
if (Test-Path $config) {
|
||||
$global:PoshSettings.Theme = (Resolve-Path -Path $config).Path
|
||||
}
|
||||
|
||||
function global:Set-PoshContext {}
|
||||
|
@ -44,7 +45,7 @@ function global:Set-PoshGitStatus {
|
|||
$config = $global:PoshSettings.Theme
|
||||
$cleanPWD = $PWD.ProviderPath.TrimEnd("\")
|
||||
$cleanPSWD = $PWD.ToString().TrimEnd("\")
|
||||
$standardOut = @(&$omp "--config=$config" "--error=$errorCode" "--pwd=$cleanPWD" "--pswd=$cleanPSWD" "--execution-time=$executionTime")
|
||||
$standardOut = @(&$omp --error="$errorCode" --pwd="$cleanPWD" --pswd="$cleanPSWD" --execution-time="$executionTime" --config="$config")
|
||||
# Restore initial encoding
|
||||
[Console]::OutputEncoding = $originalOutputEncoding
|
||||
# the ouput can be multiline, joining these ensures proper rendering by adding line breaks with `n
|
||||
|
|
|
@ -167,7 +167,7 @@ func initShell(shell, config string) string {
|
|||
}
|
||||
switch shell {
|
||||
case pwsh:
|
||||
return fmt.Sprintf("Invoke-Expression (@(&\"%s\" --print-init --shell pwsh --config %s) -join \"`n\")", executable, config)
|
||||
return fmt.Sprintf("Invoke-Expression (@(&\"%s\" --print-init --shell=pwsh --config=\"%s\") -join \"`n\")", executable, config)
|
||||
case zsh, bash, fish:
|
||||
return printShellInit(shell, config)
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue