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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,8 @@ private async Task WritePromptStringToHost()
.OfType<string>()
.FirstOrDefault() ?? "PS> ";

// 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.

{
promptString =
string.Format(
Expand Down