-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Curses programming: cursor handled incorrectly #4102
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
Yep that looks broken to me. Definitely something wrong in conpty, since this repros in inception ( (future me: I put the file in |
I expect this is the same bug as #4107. |
Nah, this one is separate from #4107. It repros in inception (#4102 (comment)), and the inbox conhost servicing interop hasn't been updated to the changeset that regressed 4107. |
## Summary of the Pull Request This is a pair of related fixes to conpty. For both of these bugs, the root cause was that the cursor was getting set to Off in conpty. Without the `CursorBlinkerTimer`, the cursor would remain off, and frames that only had cursor movements would not update the cursor position in the terminal. ## References ## PR Checklist * [x] Closes #4102 * [x] Closes #2642 * [x] I work here * [ ] Tests added/passed * [n/a] Requires documentation to be updated ## Detailed Description of the Pull Request / Additional comments Recall that there's a bunch of cursor state that's hard to parse without looking up: * `Visibility` This controls whether the cursor is visible _at all_, regardless if it's been blinked on or off * `Blinking` controls whether the blinker timer should do something, or leave the cursor alone. * `IsOn`: When the cursor is blinking, this alternates between true and false. The trick here is that we only `TriggerCursorMoved` when the cursor is `On`, and there are some scenarios where the cursor is manually set to off. Fundamentally, these two bugs are similar cases, but they are triggered by different things: * #2642 was caused by `DoSrvPrivateAllowCursorBlinking(false)` (`^[[?12l`) also manually turning the cursor off. * #4102 was caused by the client calling `SetConsoleScreenBuffer` to change the active buffer. `win-curses` actually uses that API instead of the alt buffer.
🎉This issue was addressed in #4372, which has now been successfully released as Handy links: |
Environment
Steps to reproduce
Open
cmd
orPowerShell
inside Windows Terminal, withpython
runExpected behavior
Press
a
, the cursor move to(0, 10)
immediately.Actual behavior
After pressing
a
, the cursor doesn't move to(0, 10)
immediately, i.e., the screen show doesn't change at all. Then after an another pressing, the cursor moves to(0, 10)
.P.S:
curses
bundled in Python of Linux distros.cmd
orPowerShell
without Windows Terminal.zephyrproject-rtos/windows-curses#7
The text was updated successfully, but these errors were encountered: