PowerShellEditorServices icon indicating copy to clipboard operation
PowerShellEditorServices copied to clipboard

Bring your own ReadLine

Open dkattan opened this issue 3 years ago • 1 comments

The Problem

I am unable to create a web based script editor with a terminal because both PSReadline and LegacyReadLine ultimately call Console.GetKey and Console.Write, causing the input and output to be mapped to the calling process’s Console.

Suggested Fix

Add a -UseUnderlyingHostReadline switch and change the following code:

** https://github.com/PowerShell/PowerShellEditorServices/blob/bd34695f31eebe8eaea5523a13a754da548153f5/src/PowerShellEditorServices/Services/PowerShell/Host/EditorServicesConsolePSHostUserInterface.cs#L86**

To call _underlyingHostUI.ReadLine() if -UseUnderlyingHostReadline is specified

dkattan avatar Feb 21 '22 04:02 dkattan

Linking PR https://github.com/PowerShell/PowerShellEditorServices/pull/1748

andyleejordan avatar Sep 08 '22 17:09 andyleejordan