mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-03 15:27:26 -08:00
parent
b6ac0b3904
commit
74b8a094e7
|
@ -5,7 +5,7 @@ if ($null -ne (Get-Module -Name "oh-my-posh-core")) {
|
||||||
|
|
||||||
# Helper functions which need to be defined before the module is loaded
|
# Helper functions which need to be defined before the module is loaded
|
||||||
# See https://github.com/JanDeDobbeleer/oh-my-posh/discussions/2300
|
# See https://github.com/JanDeDobbeleer/oh-my-posh/discussions/2300
|
||||||
function Get-PoshStackCount {
|
function global:Get-PoshStackCount {
|
||||||
$locations = Get-Location -Stack
|
$locations = Get-Location -Stack
|
||||||
if ($locations) {
|
if ($locations) {
|
||||||
return $locations.Count
|
return $locations.Count
|
||||||
|
@ -14,7 +14,7 @@ function Get-PoshStackCount {
|
||||||
}
|
}
|
||||||
|
|
||||||
# See https://github.com/JanDeDobbeleer/oh-my-posh/discussions/1928
|
# See https://github.com/JanDeDobbeleer/oh-my-posh/discussions/1928
|
||||||
function Test-PSDebugContext { return Test-Path Variable:/PSDebugContext }
|
function global:Test-PSDebugContext { return Test-Path Variable:/PSDebugContext }
|
||||||
|
|
||||||
New-Module -Name "oh-my-posh-core" -ScriptBlock {
|
New-Module -Name "oh-my-posh-core" -ScriptBlock {
|
||||||
$script:ErrorCode = 0
|
$script:ErrorCode = 0
|
||||||
|
@ -258,7 +258,7 @@ Example:
|
||||||
$script:TransientPrompt = $false
|
$script:TransientPrompt = $false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (Test-PSDebugContext) {
|
if (global:Test-PSDebugContext) {
|
||||||
@(Start-Utf8Process $script:OMPExecutable @("print", "debug", "--pwd=$cleanPWD", "--pswd=$cleanPSWD", "--config=$env:POSH_THEME", "--shell=::SHELL::")) -join "`n"
|
@(Start-Utf8Process $script:OMPExecutable @("print", "debug", "--pwd=$cleanPWD", "--pswd=$cleanPSWD", "--config=$env:POSH_THEME", "--shell=::SHELL::")) -join "`n"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -286,7 +286,7 @@ Example:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$stackCount = Get-PoshStackCount
|
$stackCount = global:Get-PoshStackCount
|
||||||
Set-PoshContext
|
Set-PoshContext
|
||||||
$terminalWidth = $Host.UI.RawUI.WindowSize.Width
|
$terminalWidth = $Host.UI.RawUI.WindowSize.Width
|
||||||
# set a sane default when the value can't be retrieved
|
# set a sane default when the value can't be retrieved
|
||||||
|
|
Loading…
Reference in a new issue