-
Notifications
You must be signed in to change notification settings - Fork 355
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
Prompt Rendering Issue With Autocomplete - Windows 10 x64 CMD + Powershell #70
Comments
bump | +1 I'm running in WSL (ubuntu 18.04 on Windows 10 build 17763.253) and get this on every autocomplete or similar menu. It does not differ if I'm at the bottom of the window or not. I have tried simple VT100-sequences to move "down", print some stuff and then "up" again, this works just fine (i.e as it's supposed to do). |
I did a bit of digging last year and I have a feeling that the bug is actually in https://github.com/mattn/go-colorable/blob/master/colorable_windows.go mattn/go-colorable is responsible for handling the VT control codes and converting them into Windows API calls which manipulate the console. It doesn't look like the package is handling the case where the screen buffer is already at the bottom of the actual buffer. This kind of manual scrolling of the buffer is a pain, I did some tests to see if I could fix the bug myself but eventually left it due to time constraints. It would also be possible to work around this bug inside of this package but that would go against the flow of the code, so I expect this will be down to mattn/go-colorable to fix. |
That is interesting code and I understand that problem with the buffer... |
I completely forgot it, sorry. (and I received a notification email about the issue with a new comment, but it's disappeared...?) I confirm the problem with today's master (82a9122), and here is the result. 8dac188501118e4b6c981453c29acf0f.mp4Well, I think the problem described as "Current Behavior" cannot reproduce right? If you have an opinion, please comment here. |
I am responsible for disappearing act :) |
It reproduced. Hmm... 🤔 a9a43b42e0b0ead46034d43cf1399203.mp4 |
Add SaveCursorPosition and RestoreCurcorPosition to output interafce and use it in prepareArea Fix #70 Co-authored-by: Masashi Shibata <[email protected]>
Add SaveCursorPosition and RestoreCurcorPosition to output interface and use it in prepareArea Fix #70 Co-authored-by: Masashi Shibata <[email protected]>
还没有解决啊 |
Bug reports
Expected Behavior
The prompt to allocate additional space when at the end of the consoles buffer for the autocomplete box.
Current Behavior and Steps to Reproduce
When reaching the end of a console windows buffer, if the autocomplete feature is enabled the buffer is not scrolled up to allow for space for the autocomplete suggestions. The result is that while the prompt is rendered at the bottom of the window, the actual cursor position is at the top of where the autocomplete box would have been rendered. For some reason only the bottom line of the autocomplete box is rendered.
In the screenshot below you can see the prompt at the bottom of the window with the cursor out of place a few lines above.


As soon as I start typing part of the previous output is erased and the prompt is re-rendered correctly.
Note that this only happens when the prompt is at the bottom of the consoles buffer not just the console window. ie. When the scroll bar on the console is all the way to the bottom. When there is still empty buffer space (console window scroll bar is not at the bottom) the previous output scrolls up as expected and the autocomplete box is given enough room to render.
Context
The text was updated successfully, but these errors were encountered: