-
-
Notifications
You must be signed in to change notification settings - Fork 813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DefaultRunspace.Debugger.Inbreakpoint check #406
Conversation
If I don't add that check, my prompt will always end in PS> which is quite annoying. If I check which properties are available I get: C:\opt [master]> [runspace]::DefaultRunspace.Debugger | fl * IsActive : False DebugMode : LocalScript, RemoteScript So it doesn't include InBreakpoint. Maybe it is only enabled when IsActive is true?
src/posh-git.psm1
Outdated
@@ -87,7 +87,8 @@ if ($ForcePoshGitPrompt -or !$currentPromptDef -or ($currentPromptDef -eq $defau | |||
Write-VcsStatus | |||
|
|||
# If stopped in the debugger, the prompt needs to indicate that in some fashion | |||
$debugMode = (Test-Path Variable:/PSDebugContext) -or [runspace]::DefaultRunspace.Debugger.InBreakpoint | |||
$hasInBreakpoint = [runspace]::DefaultRunspace.Debugger | Get-member -Name InBreakPoint -MemberType property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit, can you upcase the m
in M
. Also what version of PowerShell are you using? Otherwise LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind on the version, I see you're on 4.0.
src/posh-git.psm1
Outdated
@@ -87,7 +87,8 @@ if ($ForcePoshGitPrompt -or !$currentPromptDef -or ($currentPromptDef -eq $defau | |||
Write-VcsStatus | |||
|
|||
# If stopped in the debugger, the prompt needs to indicate that in some fashion | |||
$debugMode = (Test-Path Variable:/PSDebugContext) -or [runspace]::DefaultRunspace.Debugger.InBreakpoint | |||
$hasInBreakpoint = [runspace]::DefaultRunspace.Debugger | Get-Member -Name InBreakPoint -MemberType property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, one more minor nit. The name the p
in Breakpoint
should be lower case everywhere. There is one instance on this line and one on the next line. Again, sorry I didn't catch this the first time.
If I don't add that check, my prompt will always end in PS> which is quite annoying.
If I check which properties are available I get:
C:\opt [master]> [runspace]::DefaultRunspace.Debugger | fl *
IsActive : False
DebugMode : LocalScript, RemoteScript
So it doesn't include InBreakpoint. Maybe it is only enabled when IsActive is true?