Skip to content

Can't run multi-line scriptblocks longer than console vertical buffer size with transient prompt enabled in PowerShell #3452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
DEberhardt opened this issue Oct 19, 2022 · 2 comments
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@DEberhardt
Copy link

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

[2022-10-19 13:07:39]❯ $Error[0].Exception.Message
Exception calling "InvokePrompt" with "0" argument(s): "The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was -1."
[2022-10-19 13:07:57]❯ $Error[0].ScriptStackTrace
at <ScriptBlock>, <No file>: line 142
at PSConsoleHostReadLine, C:\Users\david\Documents\WindowsPowerShell\Modules\PSReadline\2.2.5\PSReadLine.psm1: line 7


### Screenshot

N/A, but easily reproducible

### Environment data

```console
PS Version: 5.1.19041.1682
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.2.5
PSReadLine EditMode: Windows
OS: 10.0.19041.1 (WinBuild.160101.0800)
BufferWidth: 171
BufferHeight: 60

and



PS Version: 7.3.0-preview.8
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.2.5
PSReadLine EditMode: Windows
OS: 10.0.19041.1 (WinBuild.160101.0800)
BufferWidth: 171
BufferHeight: 60

Steps to reproduce

I am trying to define an array of 59 users, like this:

and I get the above error.
If I paste longer text with multiple commands, this does not occur, as long as no command is longer than 50 lines for example

$UCS = @(
'sip:[email protected]',
'sip:[email protected]',
'sip:[email protected]',
[...]
'sip:[email protected]'
)
$UCS += @(
'sip:[email protected]',
'sip:[email protected]',
[...]
'sip:[email protected]'
)

Expected behavior

no keyhandler issue

Actual behavior

Command is not executed

@ghost ghost added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Oct 19, 2022
@DEberhardt
Copy link
Author

I inquired with Jan on the issue, and he pointed me your way. I could not find an open issue quickly, but you may still have this on the books. Some history on oh-my-posh regarding Transient Prompt and Oh-my-posh:
JanDeDobbeleer/oh-my-posh#2906
and
JanDeDobbeleer/oh-my-posh#2979

@daxian-dbw daxian-dbw added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. labels Nov 7, 2022
@daxian-dbw
Copy link
Member

Given this is also related to using InvokePrompt within Transient Prompt of Oh-my-posh, I will resolve it as a duplicate of #3447.
We will need to triage and see whether InvokePrompt is designed for the use of it in Oh-my-posh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

2 participants