Skip to content

Exception after maximizing and restoring a powershell window a few times on windows 10 #292

Closed

Description

Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 49 Keys:
 c d Spacebar C : Ctrl+Alt+< p r o j e c t s Ctrl+Alt+< c o r e c l r Enter
 b u Tab Enter
 Ctrl+LeftWindows Ctrl+Backspace RightArrow c d Spacebar , Backspace . . Ctrl+Alt+< c o r e f x Enter
 UpArrow UpArrow Enter
 UpArrow

Exception:
System.IO.IOException: The parameter is incorrect.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.Console.SetWindowPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender()
   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)
-----------------------------------------------------------------------

Activity

  1. MartiUK commented on Mar 24, 2016

    @MartiUK

    I can confirm this happens on Windows 7 as well, so not OS version specific.

    I can reproduce this by resizing my terminal (cmder) width down to something like 40 characters and then hitting Ctrl+C.

    It's not exactly the same error as the OP but it's probably related.

    PSReadLine: v1.0.0.13

    Exception:                                 
    System.ArgumentException: Destination array was not long enough. Check destIndex and length, and the array's lower bounds.       
       at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)                               
       at System.Array.Copy(Array sourceArray, Array destinationArray, Int32 length)      
       at PSConsoleUtilities.PSConsoleReadLine.ReallyRender()                             
       at PSConsoleUtilities.PSConsoleReadLine.CancelLine(Nullable`1 key, Object arg)     
       at PSConsoleUtilities.PSConsoleReadLine.CopyOrCancelLine(Nullable`1 key, Object arg)                                          
       at PSConsoleUtilities.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)                              
       at PSConsoleUtilities.PSConsoleReadLine.InputLoop()                                
       at PSConsoleUtilities.PSConsoleReadLine.ReadLine(Runspace remoteRunspace, EngineIntrinsics engineIntrinsics)                 
    
  2. lzybkr commented on Mar 28, 2016

    @lzybkr
    Contributor

    Try upgrading to 1.2. I think I've fixed the exception, but I still haven't fixed the messed up display after resizing and pressing a single key.

  3. miloush commented on May 3, 2016

    @miloush
    -----------------------------------------------------------------------
    Last 71 Keys:
     Ctrl+v Enter
     Ctrl+v Enter
     Ctrl+v Enter
     G e t - M a i l b o x S e a Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace s t a r t - M a i l b o x S e a r c h Spacebar b a c k u p m b o x Enter
     LeftWindows LeftWindows UpArrow
    
    Exception:
    System.IO.IOException: The parameter is incorrect.
    
       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.Console.SetWindowPosition(Int32 left, Int32 top)
       at Microsoft.PowerShell.Internal.ConhostConsole.set_WindowTop(Int32 value)
       at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender()
       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)
    -----------------------------------------------------------------------
    

    Build 14332 (so I assume 1.2).

    I did maximize the window and then used Win+Left key to dock it to the left half. Vertical scroll bar disappeared so I maximized it again.

  4. TomAafloen commented on Jun 14, 2017

    @TomAafloen

    A simple way to reproduce this error is to make PS window hight so small only the title bar is visible. Then type any character. Then make Windows bigger again and scroll up. Verified on multiple OS versions.
    See demo gif here: http://imgur.com/a/XEZ54

  5. rorychatterton commented on Jul 5, 2017

    @rorychatterton

    +1

  6. lzybkr commented on Nov 6, 2017

    @lzybkr
    Contributor

    With b2979d1, this should be completely fixed - no exception and no jumping around after resize.

  7. time-by-waves commented on Feb 2, 2018

    @time-by-waves

    So I have found this bug again, I was resizing my Window so that my folder directory was on one line and my "git push" or whatever i was writing would be on the line below, as i changed my buffer to match my window width, i noticed the G was still on the top line, i changed the buffer again, hit backspace like 4 or 5 times fast and got the following error.

    Oops, something went wrong. Please report this bug with the details below.
    Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new

    Last 200 Keys:
    a v a S c r i p t ' Enter
    c d Spacebar . / Tab Enter
    l s Enter
    c l s Enter
    g i t Spacebar i n i t Enter
    g i t Spacebar s t a t u s Enter
    UpArrow UpArrow Enter
    UpArrow UpArrow Enter
    g i t Spacebar a l Backspace d d Spacebar . Enter
    UpArrow UpArrow Enter
    g i t Spacebar c o m m i t Spacebar = Backspace - m Spacebar ' J v Backspac
    e a v a F o l d e r ' Shift+Home Ctrl+c Ctrl+c Ctrl+v Enter
    UpArrow UpArrow Enter
    g i t Spacebar p u s h Enter
    Ctrl+v Enter
    UpArrow UpArrow Enter
    UpArrow UpArrow UpArrow UpArrow Enter
    UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpA
    rrow UpArrow DownArrow Enter
    UpArrow UpArrow Enter
    UpArrow UpArrow UpArrow DownArrow DownArrow DownArrow DownArrow DownArrow U
    pArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArr
    ow Enter
    UpArrow UpArrow Enter
    LeftWindows UpArrow Backspace Backspace Backspace Backspace Backspace Backs
    pace p u Backspace u l l Enter
    l s Enter
    UpArrow Enter
    UpArrow UpArrow UpArrow Enter
    Enter
    Enter
    Enter
    g o t Backspace Backspace Backspace g i t Backspace Backspace Backspace

    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: left
    Actual value was 76.
    at System.Console.SetCursorPosition(Int32 left, Int32 top)
    at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender()
    at Microsoft.PowerShell.PSConsoleReadLine.BackwardDeleteChar(Nullable1 k ey, Object arg) at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo ke y, Dictionary2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
    at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
    at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, Eng
    ineIntrinsics engineIntrinsics)

    P

  8. rkeithhill commented on Feb 2, 2018

    @rkeithhill
    Contributor

    @greenSacrifice As an aside, if you are using posh-git, try this setting to make your prompt span two lines:

    $GitPromptSettings.AfterText = "]`n"

    gives:

    C:\Users\Keith\GitHub\dahlbyk\posh-git [develop ≡]
    > 
    

    Then you won't need to resize your window.

  9. lzybkr commented on Feb 2, 2018

    @lzybkr
    Contributor

    @greenSacrifice - this is fixed in the latest release.

  10. taoyichen commented on Sep 8, 2019

    @taoyichen

    Oops, something went wrong. Please report this bug with the details below.
    Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new

    Last 68 Keys:
    c d Space d : \ Enter
    c d Space w o Tab Enter
    . / w Tab Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter
    Enter

    Exception:
    System.IO.IOException: The parameter is incorrect.

    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    at System.Console.SetCursorPosition(Int32 left, Int32 top)
    at Microsoft.PowerShell.PSConsoleReadLine.AcceptLineImpl(Boolean validate)
    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)

  11. taoyichen commented on Sep 8, 2019

    @taoyichen

    Happens after snap right

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIt either shouldn't be doing this or needs an investigation.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions