Closed
Description
bck-i-search: app_
Oops, something went wrong. Please report this bug with the details below.
Report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new
### Environment
PSReadLine: 2.0.0-beta5
PowerShell: 7.0.0-daily.20191106
OS: Linux 4.9.112-perf #1 SMP PREEMPT Mon Jan 7 10:46:47 KST 2019
Last 200 Keys
Backspace Tab Backspace Backspace Backspace c Tab c Backspace Backspace Backspace c Backspace Backspace Enter
Enter
Ctrl+x Backspace x Backspace Backspace Backspace Ctrl+p s Backspace Backspace p s Enter
Backspace c Backspace Backspace Backspace Ctrl+v Backspace Backspace Ctrl+r Ctrl+r Backspace Backspace Backspace Backspace Backspace Backspace Backspace c Backspace Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
l s Backspace Backspace l s Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
Enter
UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow DownArrow Enter
UpArrow UpArrow UpArrow UpArrow UpArrow Enter
UpArrow Backspace Backspace 2 Backspace 1 0 0 0 0 Enter
UpArrow DownArrow DownArrow i w r Backspace Backspace Backspace i w r Spacebar Backspace Backspace Backspace Backspace Backspace Backspace Ctrl+r d Backspace s t Backspace Backspace Backspace s o f t Backspace Backspace Backspace Backspace s o f t Backspace Backspace Backspace Backspace Backspace d o w n Backspace Backspace Backspace Backspace Backspace Backspace i s o Backspace B Backspace d o w n Backspace Backspace Backspace Backspace d o w n Backspace Backspace Backspace Backspace Backspace Backspace a p p
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 'top')
Actual value was -51.
at System.Console.SetCursorPosition(Int32 left, Int32 top)
at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
at Microsoft.PowerShell.PSConsoleReadLine.UpdateHistoryDuringInteractiveSearch(String toMatch, Int32 direction, Int32& searchFromPoint)
at Microsoft.PowerShell.PSConsoleReadLine.InteractiveHistorySearchLoop(Int32 direction)
at Microsoft.PowerShell.PSConsoleReadLine.InteractiveHistorySearch(Int32 direction)
at Microsoft.PowerShell.PSConsoleReadLine.ReverseSearchHistory(Nullable`1 key, Object arg)
at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(PSKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
PS > Function Get-ProcessThreadsInfo {
>> >> [CmdletBinding()]
>> Param (
>> [Parameter(Mandatory)]
>> [int32[]]$ID >> )
>> $Processes = Get-Process -Id $ID >>
>> Foreach ($Process in $Processes) { >>
>> $ProcessThreads = $Process.Threads >> $ThreadsWithCPUTime = $ProcessThreads | Where-Object { $_.TotalProcessorTime.Ticks -ne 0 } >>
>> Foreach ($ProcessThread in $ThreadsWithCPUTime) {
>>
>> # Mapping the possible values of WaitReason to their actual meaning
>> # source: https://msdn.microsoft.com/en-us/library/tkhtkxxy(v=vs.110).aspx
>> Switch ($ProcessThread.WaitReason) {
>>
>> EventPairHigh { $Wait_ReasonPropertyValue =
>> 'Waiting for event pair high.Event pairs are used to communicate with protected subsystems'; break }
>>
>> EventPairLow { $Wait_ReasonPropertyValue =
>> 'Waiting for event pair low. Event pairs are used to communicate with protected subsystems'; break }
>>
>> ExecutionDelay { $Wait_ReasonPropertyValue =
>> 'Thread execution is delayed'; break }
>>
>> Executive { $Wait_ReasonPropertyValue =
>> 'The thread is waiting for the scheduler'; break }
>>
>> FreePage { $Wait_ReasonPropertyValue =
>> 'Waiting for a free virtual memory page'; break }
>>
>> LpcReceive { $Wait_ReasonPropertyValue =
>> 'Waiting for a local procedure call to arrive'; break }
>>
>> LpcReply { $Wait_ReasonPropertyValue =
>> 'Waiting for reply to a local procedure call to arrive'; break }
>>
>> PageIn { $Wait_ReasonPropertyValue = >> 'Waiting for a virtual memory page to arrive in memory'; break }
>>
>> PageOut { $Wait_ReasonPropertyValue =
>> 'Waiting for a virtual memory page to be written to disk'; break }
>>
>> Suspended { $Wait_ReasonPropertyValue =
>> 'Thread execution is suspended'; break }
>> >> SystemAllocation { $Wait_ReasonPropertyValue = >> 'Waiting for a memory allocation for its stack'; break } >>
>> Unknown { $Wait_ReasonPropertyValue =
>> 'Waiting for an unknown reason'; break }
>>
>> UserRequest { $Wait_ReasonPropertyValue =
>> 'The thread is waiting for a user request'; break }
>> >> VirtualMemory { $Wait_ReasonPropertyValue =
>> 'Waiting for the system to allocate virtual memory'; break }
>>
>> Default { $Wait_ReasonPropertyValue = ''; break }
>> }
>> >> # Building custom properties for my threads objects >> $Properties = @{
>> ThreadID = $ProcessThread.Id >> StartTime = $ProcessThread.StartTime
>> 'CPUTime (Sec)' = [math]::round($ProcessThread.TotalProcessorTime.TotalSeconds,2)
>> 'User CPUTime (%)' = [math]::round((($ProcessThread.UserProcessorTime.ticks / $ProcessThread.TotalProcessorTime.ticks)*100),1) >> 'System CPUTime (%)' = [math]::round((($ProcessThread.privilegedProcessorTime.ticks / $ProcessThread.TotalProcessorTime.ticks)*100),1)
>> State = $ProcessThread.ThreadState >> 'Wait Reason' = $Wait_ReasonPropertyValue
>> }
>> $CustomObj = New-Object -TypeName PSObject -Property $Properties
>> $CustomObj
>> } >> }
>> } bck-i-search: app_
Metadata
Metadata
Assignees
Labels
No labels