Skip to content
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

Merged
merged 3 commits into from
Feb 9, 2017
Merged

DefaultRunspace.Debugger.Inbreakpoint check #406

merged 3 commits into from
Feb 9, 2017

Conversation

skeept
Copy link
Contributor

@skeept skeept commented Feb 8, 2017

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?

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?
@@ -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
Copy link
Collaborator

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.

Copy link
Collaborator

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.

@@ -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
Copy link
Collaborator

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.

@rkeithhill rkeithhill merged commit 5f09094 into dahlbyk:master Feb 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants