PowerShell / PowerShell

PowerShell for every system!
https://microsoft.com/PowerShell
MIT License
44.62k stars 7.22k forks source link

Error line indication faulty in multiline prompt #21363

Open totkeks opened 6 months ago

totkeks commented 6 months ago

Prerequisites

Steps to reproduce

Use a multiline prompt setup, e.g. with the oh-my-posh configuration I posted here: https://github.com/JanDeDobbeleer/oh-my-posh/issues/4723

Start typing something that is treated like an expression, like do.

See that the prompt shows parts of the error line indicator at the end of the first line of the prompt.

Context: I tried to validate that error line is an actual feature. Using -NoProfile, even the default profile has this built-in and colors the > red, when your entered expression is not correct.

It might be possible to reproduce it with an easier prompt setup rather than going with my full blown oh-my-posh config, but I don't really know how to do that.

I would be interested in trying to look at the issue and work on the fix myself, if someone could point me in the right direction.

Expected behavior

Error line indicator starts at the first character of the second line.

Actual behavior

Error line indicator starts at the last character of the first line.

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.5.0-preview.2
PSEdition                      Core
GitCommitId                    7.5.0-preview.2
OS                             Microsoft Windows 10.0.26080
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

https://github.com/PowerShell/PowerShell/assets/2941389/1a097b69-32df-4c7b-8e48-e6b6f4b02d3b

237dmitry commented 5 months ago

Is this only on this version or on previous ones too?

totkeks commented 5 months ago

Is this only on this version or on previous ones too?

Also, in the current stable version 7.4.1 which I normally use. I just tested it in the prerelease because the issue template asked if I tried the latest version.

I guess I need to write some test prompts first to provide further context on the issue. Like a regular prompt, a multiline prompt, a multiline prompt where the first line uses the full width and a multiline prompt that uses powerline/multi-byte characters.

237dmitry commented 5 months ago

Also, in the current stable version 7.4.1 which I normally use.

Imho, this is oh-my-posh issue. I tried custom double line prompt:

ss