Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DefaultRunspace.Debugger.Inbreakpoint check#406

Merged
rkeithhill merged 3 commits into
dahlbyk:masterfrom
skeept:patch-1
Feb 9, 2017
Merged

DefaultRunspace.Debugger.Inbreakpoint check#406
rkeithhill merged 3 commits into
dahlbyk:masterfrom
skeept:patch-1

Conversation

@skeept
Copy link
Copy Markdown
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?
Comment thread src/posh-git.psm1 Outdated

# 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
Copy Markdown
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
Copy Markdown
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.

Comment thread src/posh-git.psm1 Outdated

# 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
Copy Markdown
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