PowerShell / PSReadLine

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

Oops, something went wrong. #1212

Closed he852100 closed 4 years ago

he852100 commented 4 years ago
param(
    [ValidateSet('取消购买的域名','检索指定域的详细信息','更新指定域的详细信息')]
    [string] $Name,
    [int32] $id
)

Last 200 Keys:

m a i n s / s u g g e s t Space - m e t h o d Space g e t Space - h e a d e r s Space $ h e a d e r s Enter                         
$ r e s u l t Ctrl+c Backspace Backspace Backspace $ r e s u l t Space = Space I r m Space $ u r i / v 1 / d o m a i n s / s u g g e s t Space - m e t h o d Space g e t Enter                        
g e Backspace Backspace Backspace p o Backspace Backspace p o Backspace Backspace Backspace ~ / p o Backspace Backspace p o Tab Tab Backspace Backspace Backspace Backspace Backspace g o Backspace Backspace g o Tab Tab Tab t Backspace t Tab Space - Tab Tab Tab Tab n Backspace n Tab Space Tab Tab Tab Tab Tab Tab Tab UpArrow DownArrow Backspace Tab Tab Backspace Backspace Tab Tab Tab Tab UpArrow DownArrow Backspace Tab 看 Tab Tab Backspace Backspace Backspace Tab 哈 Tab Tab Backspace Tab Tab Tab Tab Tab Tab Tab Tab Tab

Exception:

System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.                                    
Parameter name: length                                               
at System.String.Substring(Int32 startIndex, Int32 length)        
at Microsoft.PowerShell.PSConsoleReadLine.GetMenuItem(String item, Int32 columnWidth)                                               
at Microsoft.PowerShell.PSConsoleReadLine.Menu.DrawMenu(Menu previousMenu, Boolean menuSelect)                                      
at Microsoft.PowerShell.PSConsoleReadLine.PossibleCompletionsImpl(CommandCompletion completions, Boolean menuSelect)                
at Microsoft.PowerShell.PSConsoleReadLine.CompleteImpl(Boolean menuSelect)                                                          
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, CancellationToken cancellationToken) 
PSVersion                      6.2.3                              PSEdition                      Core                               GitCommitId                    6.2.3                              OS                             Linux 4.9.112-perf #1 SMP PREEMPT… Platform                       Unix
he852100 commented 4 years ago
PSVersion                      7.0.0-daily.20191121               
PSEdition                      Core                               
GitCommitId                    7.0.0-daily.20191121               
OS                             Linux 4.9.112-perf #1 SMP 
PREEMPT… Platform                       Unix

Cannot display full name 更新指定域...检索指定域...取消购买的...

msftrncs commented 4 years ago

@he852100, what version of PSReadLine are you using? You can use the script contained in https://raw.githubusercontent.com/PowerShell/PSReadLine/master/.github/ISSUE_TEMPLATE.md to find out. If its not PSReadLine 2.0.0-beta6, give that a try (available from PowerShellGallery) and see if you can still reproduce the issue.

If it continues, please include some information on what you are completing when you press tab, and what you were expecting, or which entry had just become highlighted at the time of the exception.