Skip to content

Commit ff88d24

Browse files
committed
WIP: Print prompt for F8
1 parent 940ca43 commit ff88d24

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/PowerShellEditorServices/Services/PowerShell/Execution/SynchronousPowerShellTask.cs

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
using Microsoft.Extensions.Logging;
5-
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Host;
6-
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility;
7-
using Microsoft.PowerShell.EditorServices.Utility;
84
using System;
95
using System.Collections.Generic;
106
using System.Collections.ObjectModel;
117
using System.Management.Automation;
128
using System.Management.Automation.Remoting;
139
using System.Threading;
10+
using Microsoft.Extensions.Logging;
11+
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Host;
12+
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility;
13+
using Microsoft.PowerShell.EditorServices.Utility;
1414
using SMA = System.Management.Automation;
1515

1616
namespace Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution
@@ -49,7 +49,8 @@ public override IReadOnlyList<TResult> Run(CancellationToken cancellationToken)
4949

5050
if (PowerShellExecutionOptions.WriteInputToHost)
5151
{
52-
_psesHost.UI.WriteLine(_psCommand.GetInvocationText());
52+
_psesHost.UI.Write(_psesHost.GetPrompt(cancellationToken));
53+
_psesHost.UI.Write(_psCommand.GetInvocationText());
5354
}
5455

5556
return _pwsh.Runspace.Debugger.InBreakpoint
@@ -234,7 +235,7 @@ private void StopDebuggerIfRemoteDebugSessionFailed()
234235

235236
foreach (PSObject output in outputCollection)
236237
{
237-
if (object.Equals(output?.BaseObject, false))
238+
if (Equals(output?.BaseObject, false))
238239
{
239240
_psesHost.DebugContext.ProcessDebuggerResult(new DebuggerCommandResults(DebuggerResumeAction.Stop, evaluatedByDebugger: true));
240241
_logger.LogWarning("Cancelling debug session due to remote command cancellation causing the end of remote debugging session");

src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ private void DoOneRepl(CancellationToken cancellationToken)
657657
}
658658
}
659659

660-
private string GetPrompt(CancellationToken cancellationToken)
660+
public string GetPrompt(CancellationToken cancellationToken)
661661
{
662662
var command = new PSCommand().AddCommand("prompt");
663663
IReadOnlyList<string> results = InvokePSCommand<string>(command, PowerShellExecutionOptions.Default, cancellationToken);

0 commit comments

Comments
 (0)