File tree Expand file tree Collapse file tree 4 files changed +9
-5
lines changed
src/PowerShellEditorServices/Services Expand file tree Collapse file tree 4 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ internal class ConfigurationDoneHandler : IConfigurationDoneHandler
25
25
// TODO: We currently set `WriteInputToHost` as true, which writes our debugged commands'
26
26
// `GetInvocationText` and that reveals some obscure implementation details we should
27
27
// instead hide from the user with pretty strings (or perhaps not write out at all).
28
+ //
29
+ // This API is mostly used for F5 execution so it requires the foreground.
28
30
private static readonly PowerShellExecutionOptions s_debuggerExecutionOptions = new ( )
29
31
{
30
32
MustRunInForeground = true ,
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ public bool TryTake(out T item)
65
65
66
66
public IDisposable BlockConsumers ( ) => PriorityQueueBlockLifetime . StartBlocking ( _blockConsumersEvent ) ;
67
67
68
- public void Dispose ( ) => ( ( IDisposable ) _blockConsumersEvent ) . Dispose ( ) ;
68
+ public void Dispose ( ) => _blockConsumersEvent . Dispose ( ) ;
69
69
70
70
private class PriorityQueueBlockLifetime : IDisposable
71
71
{
Original file line number Diff line number Diff line change @@ -944,6 +944,7 @@ private Runspace CreateInitialRunspace(InitialSessionState initialSessionState)
944
944
return runspace ;
945
945
}
946
946
947
+ // NOTE: This token is received from PSReadLine, and it _is_ the ReadKey cancellation token!
947
948
private void OnPowerShellIdle ( CancellationToken idleCancellationToken )
948
949
{
949
950
IReadOnlyList < PSEventSubscriber > eventSubscribers = _mainRunspaceEngineIntrinsics . Events . Subscribers ;
Original file line number Diff line number Diff line change @@ -158,11 +158,12 @@ public async Task<bool> CreateFromTemplateAsync(
158
158
_logger . LogTrace (
159
159
$ "Invoking Plaster...\n \n TemplatePath: { templatePath } \n DestinationPath: { destinationPath } ") ;
160
160
161
- PSCommand command = new ( ) ;
162
- command . AddCommand ( "Invoke-Plaster" ) ;
163
- command . AddParameter ( "TemplatePath" , templatePath ) ;
164
- command . AddParameter ( "DestinationPath" , destinationPath ) ;
161
+ PSCommand command = new PSCommand ( )
162
+ . AddCommand ( "Invoke-Plaster" )
163
+ . AddParameter ( "TemplatePath" , templatePath )
164
+ . AddParameter ( "DestinationPath" , destinationPath ) ;
165
165
166
+ // This command is interactive so it requires the foreground.
166
167
await _executionService . ExecutePSCommandAsync (
167
168
command ,
168
169
CancellationToken . None ,
You can’t perform that action at this time.
0 commit comments