Closed picnoir closed 11 months ago
Hmmm, wait a minute, I think I've been blinded by my initial bogus idea here.
Do we really need to track the console internal state or could we just send the cursorShow escape sequence regardless of the current state? :thinking:
Doing this would greatly reduce the size of this PR.
Yup, we definitely do not need to keep track of the terminal state. It reduces the diffs from 50+ to 18.
Thanks. This solves my issue.
Seems to work, code looks fine. Thank you <3
I don't have any nice automated test for this. I manually tested the patch using:
Where
test.nix
is just something really long to build:I then send sigterm/sigint through htop to the nom process.
Note: I couldn't reproduce the initial issue @mic92 is facing. The cursor was properly reset on my setup when we kill Nom through SIGTERM. The cursor was not reset when killed via SIGINT though. This patch fixes this issue, killing with SIGINT now properly reset the terminal cursor.
Fixes #114