-
Notifications
You must be signed in to change notification settings - Fork 2
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
Missing reset/cleanup in provided example (README.md) leading to terminal state corruption #3
Comments
I tried a variant without the listen() loop that works perfectly. Same thing with It seems that exiting from the listen loop creates the terminal state corruption (maybe because of a raw mode access to the terminal for reading events ?) |
Heya, let me check and I will report back shortly. |
Hey, Yes, you are right, The second part is that even after mode is restored, cursor color remains red, and not even (I would be very much interested in receiving a PR that adds this; that would be amazing!) In any case, because of inability to read terminal state, it is not possible to return the cursor color and blink to what it was before running the program; what we can do is just assume that the color before was white, and set it to white. I've updated the README example to show this, and to fix some other things -- for example, terminal type and features were printed at the top of example, but weren't visible on screen because after print the screen was switched to alternate buffer. And I've made a number of smaller clarifications/improvements in code comments. Hope it helps and thanks for the report! Feel free to continue the discussion, or close the ticket if your question was adequately covered. |
|
I added a longer description in #4. Feel free to comment there if you are interested. Regarding your project -- sounds interesting and like it could benefit both you and |
Context
I'm experiencing an issue with the example provided in the tput.cr library's
README.md
(rather than the tput.cr library itself)... and as a result, I don't know what the good practices are for using tput.cr 😓I've searched the source code and tried various things before the exit (soft_reset, clear, etc.), but I haven't (yet) found a function that solves the problem.
Environment
Reproduction Steps
shards.yml
below :README.md
insrc/test.cr
.shards build
and executed in Konsole.Observed Behavior
Insights/Fixes
The example code in tput.cr's documentation likely lacks an adequate cleanup or reset sequence for the terminal state, leading to this issue.
The text was updated successfully, but these errors were encountered: