Skip to content

Resize issue #543

Closed
Closed

Description

@EpicJoker93

Environment data

PS Version:
Major: 5
Minor: 1
Build: 15069
Revision: 413

Steps to reproduce or exception report

  1. Navigate to a path that is relatively long, for me it was: "C:\Users\User\Documents\ADRG\Apps\Momentus Creatorship\ArticleTypeOneBeta\Aemm Build\ARCapture>"
  2. Open a new Powershell window using Shift + Right mouse click in this directory then => Open PowerShell window here
  3. Type anything you want
  4. Snap the window to the left side of the screen, click out side the window to settle, you will see the path is now shortened.
  5. Then backspace everything you have typed till it hits the ">" part of the PS path.
  6. Error is displayed

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 Microsoft.PowerShell.PSConsoleReadLine.ReallyRender()
at Microsoft.PowerShell.PSConsoleReadLine.BackwardDeleteChar(Nullable1 key, Object arg) at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)

Activity

  1. lzybkr commented on Oct 17, 2017

    @lzybkr
    Contributor

    I believe this is fixed in #561.

    I'll publish a pre-release version to the PowerShell Gallery as soon as they support pre-releases.

    If you'd like to try a fix before that, you can build the lastest yourself from the master branch, or
    grab a build from AppVeyor like this one.

    Note the version number is now 2.0, so be sure to copy the contents to \PSReadLine\2.0.

  2. markvincze commented on Oct 17, 2017

    @markvincze

    I think I have another repro of the same issue:

    1. Use Powershell in cmder (http://cmder.net/), start a new cmder instance.
    2. Start a new tab (press Ctrl+T), and select to split the console to the right (so the console will be split vertically).
    3. Switch back to the original console, and press space.

    The same exception is displayed.

  3. lzybkr commented on Oct 17, 2017

    @lzybkr
    Contributor

    Thanks. The rendering code was rewritten in #561, the code raising that exception is gone. There is still a small bug with resizing the console, but it doesn't cause an exception, just a messed up render.

  4. lzybkr commented on Nov 4, 2017

    @lzybkr
    Contributor

    I'll have an official prerelease build out next week if you want to verify this is fixed, otherwise you can grab a build out of appveyor here.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions