diff --git a/src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs b/src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs index 16a7dcc49..bf0316a65 100644 --- a/src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs +++ b/src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs @@ -63,17 +63,17 @@ internal class PsesInternalHost : PSHost, IHostSupportsInteractiveSession, IRuns private EngineIntrinsics _mainRunspaceEngineIntrinsics; - private bool _shouldExit = false; + private bool _shouldExit; - private int _shuttingDown = 0; + private int _shuttingDown; private string _localComputerName; private ConsoleKeyInfo? _lastKey; - private bool _skipNextPrompt = false; + private bool _skipNextPrompt; - private bool _resettingRunspace = false; + private bool _resettingRunspace; public PsesInternalHost( ILoggerFactory loggerFactory, @@ -126,6 +126,8 @@ public PsesInternalHost( public override string Name { get; } + public override PSObject PrivateData => _hostInfo.PSHost.PrivateData; + public override PSHostUserInterface UI { get; } public override Version Version { get; } @@ -156,25 +158,13 @@ public PsesInternalHost( private bool ShouldExitExecutionLoop => _shouldExit || _shuttingDown != 0; - public override void EnterNestedPrompt() - { - PushPowerShellAndRunLoop(CreateNestedPowerShell(CurrentRunspace), PowerShellFrameType.Nested); - } + public override void EnterNestedPrompt() => PushPowerShellAndRunLoop(CreateNestedPowerShell(CurrentRunspace), PowerShellFrameType.Nested); - public override void ExitNestedPrompt() - { - SetExit(); - } + public override void ExitNestedPrompt() => SetExit(); - public override void NotifyBeginApplication() - { - _hostInfo.PSHost.NotifyBeginApplication(); - } + public override void NotifyBeginApplication() => _hostInfo.PSHost.NotifyBeginApplication(); - public override void NotifyEndApplication() - { - _hostInfo.PSHost.NotifyEndApplication(); - } + public override void NotifyEndApplication() => _hostInfo.PSHost.NotifyEndApplication(); public void PopRunspace() { @@ -188,11 +178,8 @@ public void PushRunspace(Runspace runspace) PushPowerShellAndRunLoop(CreatePowerShellForRunspace(runspace), PowerShellFrameType.Remote); } - public override void SetShouldExit(int exitCode) - { - // TODO: Handle exit code if needed - SetExit(); - } + // TODO: Handle exit code if needed + public override void SetShouldExit(int exitCode) => SetExit(); /// /// Try to start the PowerShell loop in the host.