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

Commit

Permalink
Force the prompt function
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JanDeDobbeleer committed Feb 18, 2017
1 parent 9f30885 commit ba6c891
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions oh-my-posh.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ function Set-Prompt
{
Import-Module $sl.CurrentThemeLocation

function global:prompt
{
[ScriptBlock]$Prompt = {
$lastCommandFailed = $global:error.Count -gt $sl.ErrorCount
$sl.ErrorCount = $global:error.Count

Expand All @@ -48,6 +47,8 @@ function Set-Prompt
Write-Theme -lastCommandFailed $lastCommandFailed
return ' '
}

Set-Item -Path Function:prompt -Value $Prompt -Force
}

function global:Write-WithPrompt()
Expand Down

0 comments on commit ba6c891

Please sign in to comment.