PowerShellEditorServices
PowerShellEditorServices copied to clipboard
Bring your own ReadLine
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
Linking PR https://github.com/PowerShell/PowerShellEditorServices/pull/1748