Skip to content

Respect SupportsVirtualTerminal #2277

Closed

Description

@SteveL-MSFT

Environment

PS version: 7.2.0-preview.3
PSReadline version: 2.2.0-beta2
os: Darwin MININT-E57SBHC.europe.corp.microsoft.com 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64
PS file version: 7.2.0.0
HostName: ConsoleHost
BufferWidth: 165
BufferHeight: 42

On systems where $Host.UI.SupportsVirtualTerminal is false (and not Windows), PSReadLine needs to disable some feature that rely on VT as the console output makes it unreadable.

Also, output should go through the Host and not using Console directly.

Activity

  1. ghost added
    Needs-Triage 🔍It's a new issue that core contributor team needs to triage.
    on Mar 8, 2021
  2. daxian-dbw commented on Mar 10, 2021

    @daxian-dbw
    Member

    On systems where $Host.UI.SupportsVirtualTerminal is false (and not Windows)

    Currently PSReadLine assumes VT is always supported when running on Linux and macOS. See the code snippet below. To allow PSReadLine to work on Linux without VT, an IConsole implementation like LegacyWin32Console would be needed.

    _console = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
    ? PlatformWindows.OneTimeInit(this)
    : new VirtualTerminal();

    Also, output should go through the Host and not using Console directly.

    PSReadLine uses System.Console directly all over the places, and it would be hard to change that. Why do you think the output should always go through the Host?

  3. DHowett commented on Mar 11, 2021

    @DHowett
    Contributor

    PSReadline should probably not be loaded if the user’s requested a dumb terminal :)

  4. ghost closed this as completedon Mar 18, 2021
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

      Issue actions