Skip to content
This repository was archived by the owner on Feb 16, 2021. It is now read-only.

Commit ba6c891

Browse files
Force the prompt function
Cmder uses their own prompt function. For some reason they've made it readonly, forcing us to override this when setting our prompt. How about them apples.
1 parent 9f30885 commit ba6c891

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

oh-my-posh.psm1

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ function Set-Prompt
3232
{
3333
Import-Module $sl.CurrentThemeLocation
3434

35-
function global:prompt
36-
{
35+
[ScriptBlock]$Prompt = {
3736
$lastCommandFailed = $global:error.Count -gt $sl.ErrorCount
3837
$sl.ErrorCount = $global:error.Count
3938

@@ -48,6 +47,8 @@ function Set-Prompt
4847
Write-Theme -lastCommandFailed $lastCommandFailed
4948
return ' '
5049
}
50+
51+
Set-Item -Path Function:prompt -Value $Prompt -Force
5152
}
5253

5354
function global:Write-WithPrompt()

0 commit comments

Comments
 (0)