You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Exception on non-Windows w/ command line w/ more lines than visible console buffer #663
PS version: 6.0.2
PSReadline version: 2.0.0-beta1
os: Darwin BrianShlettsMBP.attlocal.net 17.4.0 Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64
PS file version:
Last 200 Keys:
Space Space } Enter
Space Space Space Space W r i t e - V e r b o s e Space " $ ( $ M y I n v o c a t i o n . M y C o m m a n d . N a m e ) : : Space F i n i s h e d Space P r o c e s s i n g Space f i l e : Space $ F i l e P a t h " Enter
Space Space Space Space R e t u r n Space $ i n i Enter
Space Space } Enter
Enter
Space Space E n d Enter
Space Space { Enter
Space Space Space Space W r i t e - V e r b o s e Space " $ ( $ M y I n v o c a t i o n . M y C o m m a n d . N a m e ) : : Space F u n c t i o n Space e n d e d " Enter
Space Space } Enter
} Enter
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: top
Actual value was -69.
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.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)
I don't have a Mac and I tried the same on Windows without an exception.
The stack you report is hit after nearly every single character, so I think there must be something very special about what was pasted and how.
Can you try to provide some more specifics, maybe reproduce the problem with a smaller piece of text? Without more information, this would be extremely difficult to fix.
Definitely. I've been planning to look into some of these Mac related issues myself. I just wanted to make sure I didn't forget about the issue before I had a chance.
After a fair amount of experimentation, I've found that this error occurs whenever the number of lines pasted without immediate execution is greater than the number of visible lines in the terminal window. I also found that it's reproducible in the standard Mac terminal and Hyper, as well.
Steps to reproduce:
Open Terminal.app
Note the number of lines in the terminal window by looking at the title bar of the window (the default should be 24).
Enter <# on the first line and press the return key.
Press the return key N times, where N is the number of lines visible in the terminal window (this should result in N+1 lines entered total).
I haven't gotten a chance to take a look at the code at all, yet, to see why this is occurring. I'll try to get to that soon.
changed the title [-]ArgumentOutOfRangeException on MacOS 10.13.3[/-][+]Exception on non-Windows w/ command line w/ more lines than visible console buffer[/+]on Apr 7, 2018
Just another data point, I believe I'm experiencing this when listing available completions by pressing <Tab><Tab>:
Last 9 Keys:
g e t - s s m Tab Tab
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: top
Actual value was -26.
at System.Console.SetCursorPosition(Int32 left, Int32 top)
at Microsoft.PowerShell.PSConsoleReadLine.Menu.DrawMenu(Menu previousMenu)
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)
-----------------------------------------------------------------------
~> Get-SSM
Also, this may be obvious, but I'd rather include it just in case: I found that the value of the parameter top appears to be directly related to the number of lines which need to be drawn. If I increase the height of the terminal window so that the error reports Actual value was -1, I can prevent the error on the next try by increasing the terminal window's height by a single line.
I would call that a distinct bug with the same symptom. The fix will definitely be different - we should just display possible completions without using the menu if it doesn't fit on the screen.
Get the same error cutting and pasting into the integrated console. If I kill the terminal windows using the 'bin' icon and restart it resumes working...
Activity
lzybkr commentedon Apr 3, 2018
I don't have a Mac and I tried the same on Windows without an exception.
The stack you report is hit after nearly every single character, so I think there must be something very special about what was pasted and how.
Can you try to provide some more specifics, maybe reproduce the problem with a smaller piece of text? Without more information, this would be extremely difficult to fix.
bgshacklett commentedon Apr 4, 2018
Definitely. I've been planning to look into some of these Mac related issues myself. I just wanted to make sure I didn't forget about the issue before I had a chance.
bgshacklett commentedon Apr 6, 2018
After a fair amount of experimentation, I've found that this error occurs whenever the number of lines pasted without immediate execution is greater than the number of visible lines in the terminal window. I also found that it's reproducible in the standard Mac terminal and Hyper, as well.
Steps to reproduce:
<#on the first line and press the return key.I haven't gotten a chance to take a look at the code at all, yet, to see why this is occurring. I'll try to get to that soon.
[-]ArgumentOutOfRangeException on MacOS 10.13.3 under iTerm2[/-][+]ArgumentOutOfRangeException on MacOS 10.13.3[/+][-]ArgumentOutOfRangeException on MacOS 10.13.3[/-][+]Exception on non-Windows w/ command line w/ more lines than visible console buffer[/+]lzybkr commentedon Apr 7, 2018
Thanks for narrowing down the problem - I can reproduce on Linux as well, I've updated the title accordingly.
bgshacklett commentedon Apr 30, 2018
Just another data point, I believe I'm experiencing this when listing available completions by pressing
<Tab><Tab>:Also, this may be obvious, but I'd rather include it just in case: I found that the value of the parameter
topappears to be directly related to the number of lines which need to be drawn. If I increase the height of the terminal window so that the error reportsActual value was -1, I can prevent the error on the next try by increasing the terminal window's height by a single line.lzybkr commentedon Apr 30, 2018
I would call that a distinct bug with the same symptom. The fix will definitely be different - we should just display possible completions without using the menu if it doesn't fit on the screen.
SteveL-MSFT commentedon May 28, 2018
I'm working on this one
acmcg commentedon Jan 4, 2019
Get the same error cutting and pasting into the integrated console. If I kill the terminal windows using the 'bin' icon and restart it resumes working...
iamkarlson commentedon Sep 11, 2019
Hi, did you have any time to look at this issue? it's quite persistent on all of my envs (mac, conemu, ssh to pwsh)
Edited:
Looks like it's fixed in pre-release. Thanks!
msftrncs commentedon Sep 11, 2019
if not already fixed, its likely fixed by #979.
daxian-dbw commentedon Sep 12, 2019
Fixed by #979