Skip to content

Commit 2c780b9

Browse files
committed
CaptureScreen tried to set clipboard on a MTA thread
Fix is to use ExecuteOnSTAThread.
1 parent 60a2df2 commit 2c780b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PSReadLine/ScreenCapture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ private static void DumpScreenToClipboard(int top, int count)
282282

283283
dataObject.SetData(DataFormats.Text, textBuffer.ToString());
284284
dataObject.SetData(DataFormats.Rtf, rtfBuffer.ToString());
285-
Clipboard.SetDataObject(dataObject, copy: true);
285+
ExecuteOnSTAThread(() => Clipboard.SetDataObject(dataObject, copy: true));
286286
}
287287
}
288288
}

0 commit comments

Comments
 (0)