PowerShell / PowerShell/PowerShellEditorServices

Bring your own ReadLine

Open
#1,722 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Area-ReadLine Issue-Bug Up for Grabs
Dominant language
C#
Stars
767
Forks
266
Avg merge
3d 16h
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with EditorServicesConsolePSHostUserInterface.cs at the linked ReadLine implementation and trace how host options are configured. Check where a -UseUnderlyingHostReadline switch would be declared and passed, then verify that enabling it uses the underlying host UI's ReadLine while the default behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.