Skip to content

System.ArgumentOutOfRangeException when setting cursor position in PSReadLine with specific command input #4651

@lizi11q

Description

@lizi11q

Expected Behavior:
The command should compile the main.c file using gcc and execute the resulting main executable without errors.

Actual Behavior:
An exception is thrown related to the cursor position setting in PSReadLine, preventing the command from executing successfully.

PS E:\桌面\01\parctice\04_Joseph>

哎呀,出现问题。请在报告此 Bug 时添加以下详细信息。
在 GitHub 上报告: https://github.com/lzybkr/PSReadLine/issues/new

上 88 个密钥:
c d Space " e : \ 桌 面 \ 0 1 \ p a r c t i c e \ 0 4 _ J o s e p h \ " Space ; Space i f Space ( $ ? ) Space { Space g c c Space m a i n . c Space - o Space m a i n Space } Space ; Space i f Space ( $ ? ) Space { Space . \ m a i n Space } Enter

System.ArgumentOutOfRangeException: 该值必须大于或等于零,且必须小于控制台缓冲区在该维度的大小。
参数名: left
实际值是 -2。
在 System.Console.SetCursorPosition(Int32 left, Int32 top)
在 Microsoft.PowerShell.Internal.VirtualTerminal.set_CursorLeft(Int32 value)
在 Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
在 Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
在 Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
在 Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable1 key, Object arg) 在 Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary2 dispatchTable, Boolean ignoreIfNoAction, Object
arg)
在 Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
在 Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)

我要向版主描述这个问题,请给我一个title

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions