-
Notifications
You must be signed in to change notification settings - Fork 257
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
cursor.hide() isn't scoped to the current screen reference #63
Comments
Thanks for creating the issue. This should be screen specific I need. However it is supposed to do that. I'll give it a look why this is not happening. |
I can't find why this would occur. I tested in on windows and got the same result as you. I still need to give it a test on a UNIX based machine and see if it is the same there. Also, I might chek if termion has the same problem. |
I think this issue is due to not restoring the previous console/terminal settings on shutdown. When applying syscalls to hide or show cursor, it needs to be reversed on exit -- checkout termbox-go's implementation. |
yes, that might be true. Did you check this for Unix systems? For WinApi it also seems like it operates terminal based and not screen based. |
I didn't check exactly on Unix systems, but looking at termbox-go: https://github.com/nsf/termbox-go/blob/master/api.go#L129 Notice how the code, upon closing, re-establishes some default state like showing the cursor back into stdout. Not sure if Unix-y systems has an equivalent to winapi's GetConsoleState, but it would be preferable to restore the preexisting state, rather than overwriting state (even if they are sane defaults) |
Ah, oke. It is just resetting everything back to default. |
Closing in favor of https://github.com/TimonPost/crossterm/issues/new |
a quick example is if I pass in a new alternative screen and call
When switching back -- dropping the new screen that was created just for the alternative screen; the terminal still has the cursor hidden. Is this intended behavior, or do we want to have cursor behaviors scoped to the current screen?
I would imagine something like cursor.show() and .hide() works at the terminal level, so even if we create new screens, it's not like we can only modify cursor behavior for those screens...
Edit: yep, just confirmed with the alternate_screen.rs example file and it indeed doesn't scope the cursor only to the alt screen. Haven't checked by starting a new screen from within the example; but I'm sure it's related.
The text was updated successfully, but these errors were encountered: