Skip to content

Eliminate duplicate dgb prompt #627

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

Merged
merged 1 commit into from
Feb 21, 2018
Merged

Conversation

rkeithhill
Copy link
Contributor

This is to eliminate duplicate [DBG] in the prompt string for folks like me that write their prompt function to handle the DBG prompt. Without this change, my prompt looks like this:

image

And after this change:

image

Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just a quick question about the check.

// Add the [DBG] prefix if we're stopped in the debugger
if (this.powerShellContext.IsDebuggerStopped)
// Add the [DBG] prefix if we're stopped in the debugger and the prompt doesn't already have [DBG] in it
if (this.powerShellContext.IsDebuggerStopped && !promptString.Contains("[DBG]"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the check at all or could we just remove the "add DBG to string" logic entirely?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could improve the current logic but a PowerShell host typically does add [DBG]: to the beginning of the prompt during debug. However, PowerShell.exe will not do this if it has detected the user has a custom prompt function. For now, I think this is reasonable - avoid duplicate [DBG] in the prompt string.

@rkeithhill rkeithhill merged commit 99f48ae into master Feb 21, 2018
@rkeithhill rkeithhill deleted the rkeithhill/elim-dupe-dbg-prompt branch February 21, 2018 17:04
TylerLeonhardt pushed a commit to TylerLeonhardt/PowerShellEditorServices that referenced this pull request Feb 26, 2019
…tion

Add right-click context menu for Run Selection command
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.

3 participants