-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Windows REPL cursor jumps to the start under navigation keys and backspace #36584
Comments
We're often redrawing the whole line, to keep it clean. But you're just seeing how slow performing Windows is. |
I think this should stay open. Other programs, like Python, manage to have a solution on Windows that doesn't have such flickers, so it certainly seems technically feasible to have a better implementation on Windows. I'm also seeing a similar flicker in the VS Code terminal. Just out of curiosity: I think when I looked at this last, the way Julia behaved was that it had the VT sequences that Julia emits handled by libuv, right? And then libuv would be calling the old console APIs in Windows? I think for many reasons it would make a lot more sense to cut out the libuv part here and have the windows console itself handle the VT sequences directly if Julia is run on a reasonably recent Windows 10 version. Support for that has landed years ago in Windows 10. If I recall the situation correctly, then libuv actually supports that out-of-the-box for a while, but the libuv fork that Julia uses had this disabled? If I'm recalling all of this correctly, then we are going through very many emulation layers here, which could easily explain this flicker. And maybe things are better with the current, up-to-date APIs that Windows provides for console stuff? |
None of those things are relevant here. Python doesn't flicker because it's REPL is too primitive to be useful for anything much. I don't know why VS Code doesn't implement a better renderer, though I suspect the OS might just causes enough performance issue, that it can't do better on Windows. Other platforms use the same code and don't have this issue. The "new" APIs work by adding extra emulation layers that translates the codes into commands that the conhost renderer understands, similar to libuv but with more layers of emulation. |
Just some more notes for reference: For example, the Ipython REPL (i.e. not the python) is actually very feature rich, and doesn't suffer the same problems encountered in this issue. In the original case, when hitting backspace or the left/right arrow, and using a patched Julia and libuv fork, some of the issues of the navigation keys causing buggy REPL behavior are resolved. There's still a problem when you hit the UP arrow key, but the situation is improved with respect to left/right and backspace navigation. Certainly something is buggy in the current implementation, it would be good to figure out the root cause and open an upstream issue to fix this. I also tested on Linux and there this is a non-issue. Here's a comparison: |
There's a buggy behavior when hitting the backspace or the left/right/up arrows after any key which forces the cursor to jump the start of the line
See:
The text was updated successfully, but these errors were encountered: