PowerShell / PSReadLine

A bash inspired readline implementation for PowerShell
BSD 2-Clause "Simplified" License
3.77k stars 298 forks source link

UpArrow Bug - View previous commands #4129

Closed AbdurraoufE closed 3 months ago

AbdurraoufE commented 3 months ago

Prerequisites

Exception report

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)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   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

image

Environment data

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

Steps to reproduce

I'm using ipynb, with python 3.10.4 and I have this simple code:

from dotenv import load_dotenv load_dotenv() import os import openai import pinecone

I was getting errors with dotenv so I'm fixing that, but after running multiple pip install commands, I wanted to go to a previous command by using the up arrow key on my keyboard. So in my terminal, I pressed the up arrow key and got this exception

Expected behavior

Go up/review my last command in terminal that I executed

Actual behavior

UpArrow exception

github-actions[bot] commented 3 months ago

This issue was already fixed (see #1306). Please upgrade to the 2.3.5 version of PSReadLine from PowerShell Gallery. See the upgrading section for instructions. Please let us know if you run into the same issue with the latest version.