Skip to content

System.ArgumentException: Desination array was not long enough. #481

Closed

Description

@leighflix

Putting this here because the error said to:

Last 197 Keys:
c d Spacebar C : \ l e i g h \ d o c u m e n t s \ p r o j e c t s \ t e s t i n g Enter
c l e a r Enter
v i m Spacebar w h a t . 4 t h Enter
c l e a r Enter
d i r Enter
d e l Spacebar , w Tab Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace . Tab Enter
d e l Spacebar w h a t . Tab Tab Enter
c l e a r Enter
v i m Spacebar w h a t Tab Enter
c l e a r Enter
d o S m e t h n Backspace Backspace Backspace Backspace Backspace o m e t h i n g ( ) Enter
c l e a r Enter
d o S o m e t h i n g ( ) Enter
c l e a r Enter
c Backspace Backspace Backspace c l e a r Enter
c Backspace Backspace Backspace Backspace Enter
c l e a r Enter
Enter
c

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.Insert(Char c)
at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(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. leighflix commented on Dec 11, 2016

    @leighflix
    Author

    Btw, incase you actually need this info: I'm using cmder.

  2. GuilhermeMorais commented on May 27, 2017

    @GuilhermeMorais

    Hi!, the same has happened to me. I was using 2 prompts in the same window (2 tabs) on Cmder.
    See the error bellow:

    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 r t Spacebar n 3 Enter
     UpArrow UpArrow UpArrow Enter
     UpArrow Enter
     UpArrow Enter
     UpArrow Enter
     UpArrow Backspace Backspace Backspace Backspace Backspace Backspace p a u s e h a n d o f f Enter
     d o c k e r Spacebar s t o p Spacebar n 3 Enter
     d o k c c e r Spacebar s t a Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace o c k e r Spacebar s t a r t Spacebar n 3 Enter
     c o n s i s Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace UpArrow UpArrow UpArrow Backspace Backspace Backspace o m Backspace n Enter
     UpArrow Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace h e l p Enter
     UpArrow UpArrow UpArrow UpArrow UpArrow Enter
     c l e a r Enter
     l s Backspace Backspace d o c k e r Spacebar p s Enter
     d o c e r Spacebar Backspace Backspace Backspace k e r Spacebar e x e c Spacebar - i t Spacebar n 1 Spacebar o Backspace n o d e t o o l Spacebar s t a t u s Enter
     UpArrow
    
    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.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)
    
  3. helmesjo commented on Jun 9, 2017

    @helmesjo

    Another one cruising by.

    Last 200 Keys:                                                                                            
     : Spacebar M o v e d Spacebar a Spacebar l i n e Spacebar Backspace Backspace Backspace Backspace Backspa
    ce Backspace Backspace l i n e Spacebar d o w n Spacebar t o Spacebar c o r r e c t l y Backspace Backspac
    e Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace 2 Sp
    acebar s t e p s . Spacebar D o n ä ' t Spacebar Backspace Backspace Backspace Backspace ' t Spacebar Back
    space Backspace Backspace n o Spacebar w h y Spacebar I Spacebar s c r e Backspace Backspace Backspace q u
     e z e Backspace Backspace e z e d Spacebar i t Spacebar i n Spacebar b Backspace Backspace Spacebar b e t
     w e e n . . . " Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow Ctrl+LeftArrow
     Ctrl+LeftArrow LeftArrow LeftArrow Spacebar f o r Spacebar l a y o u t - r Backspace Backspace Spacebar r
     e a s o n End LeftArrow Shift+Spacebar : ) End Enter                                                     
     g i t Spacebar p u s h Enter                                                                             
     c l e a r Enter                                                                                          
     g i t Spacebar p u l l Enter                                                                             
     c l e a r Enter                                                                                          
     g                                                                                                        
                                                                                                              
    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 destinationInd
    ex, Int32 length, Boolean reliable)                                                                       
       at System.Array.Copy(Array sourceArray, Array destinationArray, Int32 length)                          
       at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender()                                               
       at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)                                               
       at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(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
    )
    
  4. xsun2001 commented on Aug 2, 2017

    @xsun2001

    Another error.
    It is Chinese but I believe that doesn't matter.
    Note I am using Cmder.

    哎呀,出现问题。请在报告此 Bug 时添加以下详细信息。
    在 GitHub 上报告: https://github.com/lzybkr/PSReadLine/issues/new
    -----------------------------------------------------------------------
    上 200 个密钥:
     s t r y Spacebar h t t p s : / / r e g i s t r y . n p m . t a o b a o . o r g Enter n p m Spacebar c o n f i g Spacebar g e t Spacebar r e g i s t r y Enter
     n p m Spacebar i n f o Spacebar e x p r e s s Enter
     DownArrow UpArrow UpArrow UpArrow UpArrow Enter
     c d Spacebar E : \ p Tab Enter
     m k d i r Spacebar h e x o - b l o g Enter
     h x Backspace e x o Spacebar i n n i t Backspace Backspace Backspace Backspace n i t Spacebar . \ Tab Backspace Backspace Backspace Backspace Backspace Backspace b Backspace h e Tab Enter
     c d Spacebar h e Tab Enter
     n p m Spacebar i n s t a l l Enter
     Backspace d i r Enter
     l l Enter
     l s Enter
     h e x o Spacebar s e r v e r Enter
     h e x o Spacebar v e r s i o n Enter
     n
    
    异常:
    System.ArgumentException: 目标数组的长度不够。请检查 destIndex 和长度以及数组的下限。
       在 System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray,  Int32 destinationIndex, Int32 length, Boolean reliable)
       在 System.Array.Copy(Array sourceArray, Array destinationArray, Int32 length)
       在 Microsoft.PowerShell.PSConsoleReadLine.ReallyRender()
       在 Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
       在 Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
       在 Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictio nary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
       在 Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
       在 Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrin sics engineIntrinsics)
    
  5. 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.

  6. 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