Skip to content

问题 #5068

@188950180-gif

Description

@188950180-gif

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

哎呀,出现问题。请在报告此 Bug 时添加以下详 
细信息。
在 GitHub 上报告: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
上 200 个密钥:
 = = = = = = = = = = = = = Enter
 Space Space Space Space p a u s e Enter    
 Space Space Space Space e x i t Space / b Space 1 Enter
 ) Enter
 Enter
 e c h o . Enter
 p a u s e Enter
 " @ Enter
 Enter
 $ b u i l d A p k C o n t e n t Space | Space O u t - F i l e Space - F i l e P a t h Space " b u i l d _ a p k . b a t " Space - E n c o d i n g Space a s c i i Enter        
 Enter
 W r i t e - H o s t Space " b u i l d _ a p k . b a t Space c r e a t e d Space s u c c e s s f u l l y ! " Space - F o r e g r o u n d C o l o r Space G r e e n Enter        


异常:
System.ArgumentOutOfRangeException: 该值必须
大于或等于零,且必须小于控制台缓冲区在该维度
的大小。
参数名: top
实际值是 -26。
   在 System.Console.SetCursorPosition(Int32 left, Int32 top)
   在 Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String 
defaultColor)
   在 Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   在 Microsoft.PowerShell.PSConsoleReadLine.AcceptLineImpl(Boolean validate)
   在 Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   在 Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   在 Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)

Screenshot

n

Environment data

& {
    $hostName = $Host.Name
    if ($hostName -eq "ConsoleHost" -and (Get-Command Get-CimInstance -ErrorAction SilentlyContinue)) {
        $id = $PID; $inWindowsTerminal = $false
        while ($true) {
            $p = Get-CimInstance -ClassName Win32_Process -Filter "ProcessId Like $id"
            if (!$p -or !$p.Name) { break }
            if ($p.Name -eq "WindowsTerminal.exe") { $inWindowsTerminal = $true; break }
            $id = $p.ParentProcessId
        }
        if ($inWindowsTerminal) { $hostName += " (Windows Terminal)" }
    }

    $m = Get-Module PSReadline
    $v = $m.Version; $pre = $m.PrivateData.PSData.Prerelease
    if ($pre) { $v = "$v-$pre" }
    $os = if ($IsLinux -or $IsMacOS) { uname -a } else { (dir $env:SystemRoot\System32\cmd.exe).VersionInfo.FileVersion }

    Write-Host ''
    Write-Host "PS Version: $($PSVersionTable.PSVersion)"
    Write-Host "PS HostName: $hostName"
    Write-Host "PSReadLine Version: $v"
    Write-Host "PSReadLine EditMode: $((Get-PSReadLineOption).EditMode)"
    Write-Host "OS: $os"
    Write-Host "BufferWidth: $([console]::BufferWidth)"
    Write-Host "BufferHeight: $([console]::BufferHeight)"
    Write-Host ''
}

Steps to reproduce

n

Expected behavior

n

Actual behavior

n

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions