Skip to content

Commit 01c8e52

Browse files
committed
Only set pipeline thread apartment state on Windows
1 parent 5376d41 commit 01c8e52

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ public PsesInternalHost(
9696
Name = "PSES Pipeline Execution Thread",
9797
};
9898

99-
_pipelineThread.SetApartmentState(ApartmentState.STA);
99+
if (VersionUtils.IsWindows)
100+
{
101+
_pipelineThread.SetApartmentState(ApartmentState.STA);
102+
}
100103

101104
PublicHost = new EditorServicesConsolePSHost(this);
102105
Name = hostInfo.Name;

0 commit comments

Comments
 (0)