From de4f39bfeb69c7bf19bc02784b7209fdabcc88f0 Mon Sep 17 00:00:00 2001 From: "Tyler Leonhardt (POWERSHELL)" Date: Tue, 25 Feb 2020 12:33:12 -0800 Subject: [PATCH] also check for tempSession --- src/PowerShellEditorServices/Server/PsesDebugServer.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PowerShellEditorServices/Server/PsesDebugServer.cs b/src/PowerShellEditorServices/Server/PsesDebugServer.cs index 421c29b78..81ef23e55 100644 --- a/src/PowerShellEditorServices/Server/PsesDebugServer.cs +++ b/src/PowerShellEditorServices/Server/PsesDebugServer.cs @@ -76,7 +76,8 @@ public async Task StartAsync() _powerShellContextService.IsDebugServerActive = true; // Needed to make sure PSReadLine's static properties are initialized in the pipeline thread. - if (_usePSReadLine && Interlocked.Exchange(ref s_hasRunPsrlStaticCtor, 1) == 0) + // This is only needed for Temp sessions who only have a debug server. + if (_usePSReadLine && _useTempSession && Interlocked.Exchange(ref s_hasRunPsrlStaticCtor, 1) == 0) { // This must be run synchronously to ensure debugging works _powerShellContextService