Skip to content

Exception when used in Cursor (some times) #4759

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

Open
3 tasks done
Frulfump opened this issue May 25, 2025 · 0 comments
Open
3 tasks done

Exception when used in Cursor (some times) #4759

Frulfump opened this issue May 25, 2025 · 0 comments
Labels
Needs-Triage 🔍 It's a new issue that core contributor team needs to triage.

Comments

@Frulfump
Copy link

Frulfump commented May 25, 2025

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

System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than t
he console's buffer size in that dimension. (Parameter 'top')
Actual value was 4.
   at System.ConsolePal.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.Internal.VirtualTerminal.SetCursorPosition(Int32 left, Int32 top)       
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColo
r)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Render()
   at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(PSKeyInfo key, Dictionary`2 dispatchTabl
e, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineInt
rinsics, CancellationToken cancellationToken, Nullable`1 lastRunStatus)

Last 200 Keys:

r u e ) ; Spacebar r e a d e r Spacebar = Spacebar e a s y o c r . R e a d e r ( [ ' e n ' ] , Spa
cebar g p u = F a l s e ) ; Spacebar p r i n t ( ' R e a d e r Spacebar i n i t i a l i z e d : ' ,
Spacebar r e a d e r Spacebar i s Spacebar n o t Spacebar N o n e ) " Enter
u v Spacebar r u n Spacebar p y t e s t Spacebar t e s t s / i n t e g r a t i o n / t e s t _ m e
n u _ n a v i g a t i o n _ i n t e g r a t i o n . p y : : T e s t M e n u N a v i g a t i o n I
n t e g r a t i o n : :

Screenshot

N/A

Environment data

PSReadLine: 2.3.6+d2e770f93b7a53d8660a6402eb29d1ae1c35e767
PowerShell: 7.5.1
OS: Microsoft Windows 10.0.19045
BufferWidth: 99
BufferHeight: 1

Steps to reproduce

It happens some times (sorry, but atleast some safe guard around the exception could be added even without proper repro steps I hope).

I have added Set-PSReadLineOption -PredictionSource None before I start my session but this doesn't seem to help as I get the exception above. And I tried to remove PSReadLine with Remove-Module PSReadLine -ErrorAction SilentlyContinue but it seems to load the default version of PSReadLine shiped with pwsh then.

Expected behavior

No Exception...

Actual behavior

The above exception happens...

@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 May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Triage 🔍 It's a new issue that core contributor team needs to triage.
Projects
None yet
Development

No branches or pull requests

1 participant