Skip to content

Bring your own ReadLine #1722

@dkattan

Description

@dkattan
Contributor

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:

**

public override string ReadLine() => _readLineProvider.ReadLine.ReadLine(CancellationToken.None);
**

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

Activity

ghost added
Needs: TriageMaintainer attention needed!
on Feb 21, 2022
moved this from P0- In Progress to Wishlist in American Pharoah on May 3, 2022
andyleejordan

andyleejordan commented on Sep 8, 2022

@andyleejordan
Member

Linking PR #1748

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @dkattan@andyleejordan@StevenBucher98

        Issue actions

          Bring your own ReadLine · Issue #1722 · PowerShell/PowerShellEditorServices