DefaultRunspace.Debugger.Inbreakpoint check#406
Merged
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?
rkeithhill
requested changes
Feb 8, 2017
|
|
||
| # 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 |
Collaborator
There was a problem hiding this comment.
Minor nit, can you upcase the m in M. Also what version of PowerShell are you using? Otherwise LGTM.
Collaborator
There was a problem hiding this comment.
Nevermind on the version, I see you're on 4.0.
rkeithhill
approved these changes
Feb 8, 2017
rkeithhill
reviewed
Feb 8, 2017
|
|
||
| # 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 |
Collaborator
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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?