Skip to content

Terminal bug report telling me to tell github #4252

@SomeKindOfGeek

Description

@SomeKindOfGeek

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

Last 200 Keys:
 a r t - s l e e p Space - s e c o n d s Space 3 Enterolor -Red
 Space w r i t e - h o s t Space " R U N . . . Space > : ) " Space - F o r e g r o u n d C o l o r Space - R e d Enter
 Space } Enter
 Space } Enter = [int](read-Host "ENTER PASSWORD: $x x $y " ) -ForegroundColor -Blue
 Space h e l l o UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow
>>  Write-Host "FALSE ALARM" -ForegroundColor -Green
Exception:sleep -seconds 0.7
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 -1.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)egroundColor -Blue
   at Microsoft.PowerShell.PSConsoleReadLine.MoveCursor(Int32 newCursor)
   at Microsoft.PowerShell.PSConsoleReadLine.MoveToLine(Int32 numericArg)
   at Microsoft.PowerShell.PSConsoleReadLine.HistoryRecall(Int32 direction)
   at Microsoft.PowerShell.PSConsoleReadLine.PreviousHistory(Nullable`1 key, Object arg)
   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)

Screenshot

n/a

Environment data

PS Version: 5.1.19041.5007
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.0.0-beta2
PSReadLine EditMode: Windows
OS: 10.0.19041.1 (WinBuild.160101.0800)
BufferWidth: 120
BufferHeight: 30

Steps to reproduce

function hello {
clear-Host
$y = get-random -Minimum 6 -Maximum 15
$x = $number = get-random -Minimum 6 -Maximum 15
$product = $x * $y

Write-Host "SECURITY BREACH DECTECTED" ForegroundColor -Red
start-sleep -seconds 1

$userInput = int -ForegroundColor -Blue
start-sleep -seconds 0.5
write-host "3..." ForegroundColor -Green
start-sleep -seconds 0.5
write-host "2..." ForegroundColor -Green
start-sleep -seconds 0.5
write-host "1..." ForegroundColor -Green

if ($userInput -eq $product) {
clear-host
Write-Host "FALSE ALARM" -ForegroundColor -Green
start-sleep -seconds 0.7
write-host "LOCKDOWN DEACTIVATING" -ForegroundColor -Green

} else {
clear-host
write-host "Hello, I am Justin Treudo. I SEE YOU..." -ForegroundColor -Blue
start-sleep -seconds 3
write-host "RUN... >:)" -ForegroundColor -Red
}
}
hello

Expected behavior

It should just give you an error message

Actual behavior

It gives me an error message, and I am unable to edit the code

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