-
Notifications
You must be signed in to change notification settings - Fork 314
bck-i-search (Ctrl-R) quits accepting input when it finds a very long command #1083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@Narvey, you should give PSReadline 2.0.0-beta5 a try, from PowerShellGallery. I cannot say that it will help or entirely eliminate the issue, but a better error report may be possible, knowing how the latest version handles. |
The |
@Narvey I will close this issue. If you run into the same issue with |
@daxian-dbw, I just had this issue occur on me, when using the CTRL-R search in a 7.0.0-preview5 session in VS Code's terminal, when the resulting found history item was longer than the terminal buffer (which is only a few lines (19). Then things became really goofy, because the search prompt remained on the screen, but keypresses edited the command that was pulled up, even after pressing escape I could not close the search using escape. instead I had to press CTRL-R or CTRL-S to get the input going back to the right place, without any exceptions occurring, and then press escape. Edit: It was a PowerShell Integrated Console, incase that becomes important. |
Thanks @msftrncs. Re-open this issue. |
To produce a good reproduction of this issue
Reference code (you will probably not be able to paste this in to VS Code's terminal) (
$ZQZV # because its unique
# 2
# 3
# 4
# 5
# 6
# 7
# 8
# 9
# 10
) After entering the above as a command and posting it to history, press CTRL-R and type Exception
Any less than the |
Its purposely trying to put the cursor where the text was found, but that location has scrolled off the screen. |
The exception when the search is cleared (when it hadn't first asserted an exception) is different: Exception
|
In the case of this second exception, the PSReadLine/PSReadLine/Render.cs Lines 796 to 810 in 664b168
So the |
Experimenting with a solution for this, seems the code causing the exception when right-click pasting in Windows Terminal might be closely related. |
I am also reproing this on RC1 |
When I press Ctrl-R, I keep having this gigantic line I once pasted in pop up in the history and clobber the bck-i-search. All the keyboard input then goes at the end of the giant command and so I can't finish typing into bck-i-search the rest of what I wanted to search for. Worse still, Ctrl-C does not get me out, and Ctrl-D just puts ^D on the end of the command. Up arrow does get me out, but causes the below exception.
Environment data
PS version: 5.1.18362.145
PSReadline version: 2.0.0-beta2
os: 10.0.18362.1 (WinBuild.160101.0800)
PS file version: 10.0.18362.1 (WinBuild.160101.0800)
BufferWidth: 120
BufferHeight: 3000
Steps to reproduce or exception report
Last 4 Keys:
Ctrl+r b a UpArrow
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 -4965.
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.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)
The text was updated successfully, but these errors were encountered: