Skip to content
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

Exception when changing the position of the window and minimizing it while writing a cmdlet. #3816

Closed
3 tasks done
M0ST4FA opened this issue Sep 29, 2023 · 6 comments
Closed
3 tasks done
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@M0ST4FA
Copy link

M0ST4FA commented Sep 29, 2023

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

Oops, something went wrong.
Please report this bug with ALL the details below, including both the 'Environment' and 'Exception' sections.
Please report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new?template=Bug_Report.yaml
Thank you!

### Environment
PSReadLine: 2.2.6
PowerShell: 7.3.7
OS: Microsoft Windows 10.0.22621
BufferWidth: 70
BufferHeight: 17

Last 200 Keys:

 Tab Enter UpArrow Ctrl+Backspace Ctrl+Backspace Ctrl+Backspace Ctrl+Backspace Ctrl+Backspace Ctrl+Backspace Ctrl+Backspace Ctrl+Backspace Ctrl+Backspace Ctrl+Backspace Ctrl+Backspace Ctrl+Backspace c l s Enter c l s Enter s l Spacebar ' L e a r RightArrow Enter d i r Enter n u Tab Enter d i r Enter c l s Enter s l Spacebar M e RightArrow Enter c l s Enter i n i t i Tab Spacebar - p e r Tab Spacebar ' s t u d Tab Backspace Backspace Backspace Backspace 1 s Tab RightArrow Enter c l s Enter i n i t i Tab Spacebar - p e Backspace Backspace o p Tab Enter i n i t i Tab Spacebar - o p Tab Spacebar ' Ctrl+Backspace Ctrl+Backspace p Tab Spacebar - s u b Tab Spacebar ' 2 n Tab Tab Backspace Backspace Ctrl+Backspace p e r Tab Spacebar ' 2 Tab RightArrow Enter c l s Enter . Spacebar . \ RightArrow Ctrl+Backspace Ctrl+Backspace Ctrl+Backspace Backspace Backspace M a t h e RightArrow Enter d i r Enter . Spacebar Ctrl+Backspace g e t - m a e Backspace Backspace e a n Tab Spacebar - d a Tab Spacebar @ ( 6

### Exception

System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension. (Parameter 'top')
Actual value was 17.
   at System.ConsolePal.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Render()
   at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(PSKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken, Nullable`1 lastRunStatus)

Screenshot

N/A

Environment data

PS Version: 7.3.7
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.2.6
PSReadLine EditMode: Windows
OS: 10.0.22621.1 (WinBuild.160101.0800)
BufferWidth: 120
BufferHeight: 30

Steps to reproduce

  1. Start writing a cmdlet (say, for example Get-Process).
  2. Before finishing (e.g. at Get-) move the window to the bottom left (using windows key and arrows).
  3. Continue writing the cmdlet.

Expected behavior

No exception.

Actual behavior

Exception.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Sep 29, 2023
@daxian-dbw
Copy link
Member

@M0ST4FA I cannot reproduce the issue locally. My OS version is 10.0.22621.0. Can you please share a GIF to show the repro?

@daxian-dbw daxian-dbw added the Needs-Repro There is no sufficient information on repro steps. label Oct 2, 2023
@daxian-dbw
Copy link
Member

Any chance you are using oh-my-posh? We had a similar report that also happens when a oh-my-posh prompt is in use: #3750 (comment). Let me know if that's the case for you too.

@M0ST4FA
Copy link
Author

M0ST4FA commented Oct 3, 2023

@M0ST4FA I cannot reproduce the issue locally. My OS version is 10.0.22621.0. Can you please share a GIF to show the repro?

PS Bug

For some reason, it doesn't happen when I try to do it again. It happened only two times.
When it happened, however, when I scrolled upwards to see the results of the command I saw the exception report I sent before. The command runs normally after the exception, i.e., the exception happens and then the command runs.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention 👋 and removed Needs-Repro There is no sufficient information on repro steps. labels Oct 3, 2023
@M0ST4FA
Copy link
Author

M0ST4FA commented Oct 3, 2023

Any chance you are using oh-my-posh? We had a similar report that also happens when a oh-my-posh prompt is in use: #3750 (comment). Let me know if that's the case for you too.

Yes, I use oh-my-posh.

@daxian-dbw
Copy link
Member

Thanks for the additional information. I think this is a duplicate of #3750, related to using a oh-my-posh prompt.

@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. Needs-Attention 👋 labels Oct 3, 2023
@M0ST4FA
Copy link
Author

M0ST4FA commented Oct 4, 2023

Thanks for the additional information. I think this is a duplicate of #3750, related to using a oh-my-posh prompt.

Indeed, I've tried to do the same thing without oh-my-posh turned on, and there was no bug (you see the command gets copied down) when I changed the position of the window.

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