Skip to content

Commit 2a3fa0b

Browse files
committed
Fix #130: Reduce prompt noise in debug adapter
This change keeps the debug adapter from printing the prompt until the user enters a command. This will allow breakpoints to be hit without the prompt being shown every time. The change also trims the ending '>' character off of the end of the prompt to reduce user confusion about where commands should be typed.
1 parent 2bdf4bf commit 2a3fa0b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/PowerShellEditorServices/Session/PowerShellContext.cs

+8-2
Original file line numberDiff line numberDiff line change
@@ -905,10 +905,15 @@ private void WritePromptToHost(Func<PSCommand, string> invokeAction)
905905
Environment.NewLine,
906906
false);
907907

908+
// Trim the '>' off the end of the prompt string to reduce
909+
// user confusion about where they can type.
910+
// TODO: Eventually put this behind a setting, #133
911+
promptString = promptString.TrimEnd(' ', '>', '\r', '\n');
912+
908913
// Write the prompt string
909914
this.WriteOutput(
910915
promptString,
911-
false);
916+
true);
912917
}
913918

914919
private void WritePromptWithRunspace(Runspace runspace)
@@ -974,7 +979,8 @@ private void OnDebuggerStop(object sender, DebuggerStopEventArgs e)
974979
null));
975980

976981
// Write out the debugger prompt
977-
this.WritePromptWithNestedPipeline();
982+
// TODO: Eventually re-enable this and put it behind a setting, #133
983+
//this.WritePromptWithNestedPipeline();
978984

979985
// Raise the event for the debugger service
980986
if (this.DebuggerStop != null)

0 commit comments

Comments
 (0)