Exception when switching from full screen to windowed
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 28/100
Research direction
Start with the BackwardChar entry in the reported stack trace and compare it with the full-screen and windowed BufferWidth and BufferHeight values. Try the described Windows Terminal resize and wake sequence, then determine whether it can be made to complete without the console cursor-position exception; the issue is done when the transition no longer produces this failure.
Written by the indexing model from the issue text.
Description
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.3.6+d2e770f93b7a53d8660a6402eb29d1ae1c35e767
PowerShell: 7.5.2
OS: Microsoft Windows 10.0.22000
BufferWidth: 119
BufferHeight: 27
Last 200 Keys:
LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow
### 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 48.
at System.ConsolePal.SetCursorPosition(Int32 left, Int32 top)
at Microsoft.PowerShell.PSConsoleReadLine.BackwardChar(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
I had left my Terminal in full-screen mode for a long time. (Note, background image is an animated GIF. I don't know if that's relevant.) The last thing on the display was an output of "ls."
Full screen screenshot:
The display went to sleep after some time (~1 hour). I came back to the computer after a while and tried to wake it up by repeatedly hitting the space bar. I woke the display (which I think was still normal?) and then tried to take Terminal out of full screen mode. I hit Esc but it stayed full screen. I couldn't remember the key to take it out of full screen (I believe I tried F11). I must've hit something that worked, because the Terminal window switched from full screen to windowed... but then I saw the PowerShell exception.
Windowed screenshot:
The exception seems to be saying I had entered hundreds of "LeftArrow" characters? Which I can assure you is not the case: I don't think I hit "Left Arrow" once during this time I was trying to exit full screen.
Obviously the window size changed when I hit F11 to go from full screen to windowed. The BufferWidth and BufferHeight changed:
Full screen:
- BufferWidth: 179
- BufferHeight: 49
Windowed:
- BufferWidth: 119
- BufferHeight: 38
Environment data
FULL SCREEN:
PS Version: 7.5.2
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.3.6
PSReadLine EditMode: Windows
OS: 10.0.22000.1 (WinBuild.160101.0800)
BufferWidth: 179
BufferHeight: 49
WINDOWED:
PS Version: 7.5.2
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.3.6
PSReadLine EditMode: Windows
OS: 10.0.22000.1 (WinBuild.160101.0800)
BufferWidth: 119
BufferHeight: 38
Steps to reproduce
I cannot seem to reproduce doing the steps I performed before (full screen with alt-Enter, exit full screen with spacebar/Esc/F11).
Expected behavior
No exception expected. No references to repeated presses of "Left Arrow" key expected.
Actual behavior
The above exception happened once.
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 341
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PowerShell/PSReadLine
-
Needs-Triage :mag:
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PowerShell/PSReadLine#5205 ·
-
Needs-Triage :mag:
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
PowerShell/PSReadLine#5195 ·
-
Needs-Triage :mag:
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PowerShell/PSReadLine#5121 ·
-
Needs-Triage :mag:
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
PowerShell/PSReadLine#5045 ·
-
Area-CommandHelp Issue-Enhancement
Difficulty 1/5 Under an hour Newbie friendliness 68/100
PowerShell/PSReadLine#3470 · 3 reactions ·
All issues in PowerShell/PSReadLine
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 75/100
sillsdev/languageforge-lexbox#2665 ·
-
bug documentation frontend
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
azurenoops/spin_agent#975 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·