question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception when recalling command line with more lines than screen

See original GitHub issue

PSReadLine crashes when doing Up arrow looking for commands that has been previously executed.

Environment data

Provide the output of the following:

& {
    "PS version: $($PSVersionTable.PSVersion)"
    $v = (Get-Module PSReadline).Version
    $m = Get-Content "$(Split-Path -Parent (Get-Module PSReadLine).Path)\PSReadLine.psd1" | Select-String "Prerelease = '(.*)'"
    if ($m) {
        $v = "$v-" + $m.Matches[0].Groups[1].Value
    }
    "PSReadline version: $v"
    if ($IsLinux -or $IsMacOS) {
        "os: $(uname -a)"
    } else {
        "os: $((dir $env:SystemRoot\System32\cmd.exe).VersionInfo.FileVersion)"
    }
    "PS file version: $((dir $pshome\p*[hl].exe).VersionInfo.FileVersion)"
}

PS version: 6.1.0-preview.1
PSReadline version: 1.2
os: Linux mars 4.13.0-38-generic #43-Ubuntu SMP Wed Mar 14 15:20:44 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
PS file version: 

–>

Steps to reproduce or exception report

Use the keyboard up arrow to scan thru previous entered commands. Exception message:

Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 25 Keys:
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

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 -25.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.Internal.TTYConsole.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.PlaceCursor(Int32 x, Int32& y)
   at Microsoft.PowerShell.PSConsoleReadLine.PlaceCursor()
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Render()
   at Microsoft.PowerShell.PSConsoleReadLine.UpdateFromHistory(Boolean moveCursor)
   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)
-----------------------------------------------------------------------

psreadline_error_2018-04-23_15-40-01

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bgshacklettcommented, Apr 24, 2018

Is this potentially related to #663?

0reactions
lzybkrcommented, Apr 24, 2018

Yep, I recalled the other but didn’t look for it. Thanks @bgshacklett.

Read more comments on GitHub >

github_iconTop Results From Across the Web

logging - More lines in command window
Go to properties as mentioned by Kristina; Go to the layout tab (that's the third one); Modify the screen buffer size's height -...
Read more >
Using the Command-Line Interface [Cisco Catalyst Micro ...
The More prompt is used for any output that has more lines than can be displayed on the terminal screen, including show command...
Read more >
Command Line Tips and Tricks - Using IDL - NV5 Geospatial
You can change the number of command lines saved in the recall buffer by setting the IDL_RBUF_SIZE preference equal to a number other...
Read more >
Screen User's Manual
1 Overview. Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells.
Read more >
Set-PSReadLineOption (PSReadLine) - PowerShell
Specifies the number of extra lines. If your prompt spans more than one line, specify a value for this parameter. Use this option...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found