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

PSreadline expcetion report #4230

Closed
3 tasks done
CN-CODEGOD opened this issue Oct 17, 2024 · 5 comments
Closed
3 tasks done

PSreadline expcetion report #4230

CN-CODEGOD opened this issue Oct 17, 2024 · 5 comments
Labels
Needs-Repro There is no sufficient information on repro steps. Resolution-Not Repro The issue cannot be reproduced.

Comments

@CN-CODEGOD
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

PS>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.5+2cc85806c561a9395751a96a818e8ff1592d19f7
> PowerShell: 7.4.5
> OS: Microsoft Windows 10.0.19045
> BufferWidth: 120
> BufferHeight: 9001
>
> Last 200 Keys:
>
>  RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace End Backspace Backspace Backspace s LeftArrow End Spacebar " LeftWindows Ctrl+v " Enter
>  UpArrow 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 RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow LeftArrow LeftArrow LeftArrow LeftArrow LeftArrow " RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow RightArrow LeftArrow LeftArrow LeftArrow LeftArrow " Enter
>  s t a r t Spacebar RightArrow Enter
>  c l s Enter
>  d Backspace Backspace d
>
> ### Exception
>
> System.IO.IOException: 参数错误。
>    at System.ConsolePal.SetCursorPosition(Int32 left, Int32 top)
>    at Microsoft.PowerShell.PSConsoleReadLine.CalculateWhereAndWhatToRender(Boolean cursorMovedToInitialPos, RenderData renderData, LineInfoForRendering& lineInfoForRendering)
>    at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
>    at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
>    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

image

Environment data

PS Version: 7.4.5
PS HostName: ConsoleHost
PSReadLine Version: 2.3.5
PSReadLine EditMode: Windows
OS: 10.0.19041.4522 (WinBuild.160101.0800)
BufferWidth: 317
BufferHeight: 9001

Steps to reproduce

typing with chinese input method

Expected behavior

null

Actual behavior

null

@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 Oct 17, 2024
@daxian-dbw
Copy link
Member

@CN-CODEGOD Can you please provide the repro steps? Without them, there isn't much that we can do ... Thanks!

@CN-CODEGOD
Copy link
Author

@CN-CODEGOD Can you please provide the repro steps? Without them, there isn't much that we can do ... Thanks!

do you know what happen .i was accidently get the bug from psreadline ,sorry i can't provide a repro step,

@daxian-dbw
Copy link
Member

Thanks @CN-CODEGOD for opening the issue. However, I have to close it because there is no sufficient information for the investigation.

@daxian-dbw daxian-dbw added Needs-Repro There is no sufficient information on repro steps. Resolution-Not Repro The issue cannot be reproduced. and removed Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. labels Oct 18, 2024
@Poltergeisen
Copy link

Poltergeisen commented Oct 18, 2024

I'm also seeing the same thing. @daxian-dbw, I just installed the gh CLI today with winget

winget install --id GitHub.cli

Then with this code in my $profile:

kubectl completion powershell | Out-String | Invoke-Expression
flux completion powershell | Out-String | Invoke-Expression
gh completion -s powershell | Out-String | Invoke-Expression

set-alias -name tf -value terraform
set-alias -name k -value kubectl




Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete

when I type gh copilot and hit tab it throws this exception.

Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 18 Keys:
 g h Space c Backspace Tab Escape c o Tab p o i Backspace Backspace i Tab Tab                                           
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 name: top
Actual value was -18.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.Menu.EnsureMenuAndInputIsVisible(IConsole console, Int32 tooltipLineCount)
   at Microsoft.PowerShell.PSConsoleReadLine.Menu.DrawMenu(Menu previousMenu)
   at Microsoft.PowerShell.PSConsoleReadLine.PossibleCompletionsImpl(CommandCompletion completions, Boolean menuSelect)
   at Microsoft.PowerShell.PSConsoleReadLine.CompleteImpl(Boolean menuSelect)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------

@daxian-dbw

@Poltergeisen
Copy link

For anyone else viewing this, my problem was with an outdated ps readline. The github actions bot here solved my problem:

#4232

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Repro There is no sufficient information on repro steps. Resolution-Not Repro The issue cannot be reproduced.
Projects
None yet
Development

No branches or pull requests

3 participants