Skip to content

PowerShell Session Multiline Wrong Highlighting #2262

@iansedano

Description

@iansedano

It seems that using the "PowerShell Session" highlighter won't pick up multiline constructs, and renders anything after the first line as output.

For instance:

PS> python -m doctest `
> -o DONT_ACCEPT_TRUE_FOR_1 `
> -o ELLIPSIS options.txt

Renders like this in https://pygments.org/demo/

image

I initially thought it might be the backtick as the line continuation character, but it seems that any multiline construct is not picked up properly, for example:

PS>  $Params = @{
>     Height = 50
>     Width  = 50
>     Depth  = 50
>     Name   = 'My Widget'
>     ID     = '10dbe43f-0269-48b8-96cb-447a755add55'
> }

image

Or

PS>  ls |
> grep "python"

image


On my command line emulator (Windows Terminal), it looks something like this with PowerShell Core:

image

On the old Windows PowerShell, with conhost.exe, it looks like this:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions