lune
lune copied to clipboard
[BUG]: SIGINT during an stdio.prompt selection list hides terminal cursor
When pressing Control-C on either Git Bash or Windows 11 terminal during a select or multiselect prompt via stdio.prompt, the terminal's cursor is hidden. This persists even through clears and requires you to start up a new terminal window.
I cannot reproduce this on the Windows Terminal (which is what I assume you are referring to as Windows 11 terminal). Haven't tested on Git Bash/CYGWin/MinGW terminals though.
This bug happens on both Git Bash and the default Windows terminal program/command prompt.
This bug happens on both Git Bash and the default Windows terminal program/command prompt.
Any specific reproducible code in that case? Like I said, I've tried some code which would allegedly cause this, but with no luck.
local stdio = require("@lune/stdio")
stdio.prompt("confirm", `Please confirm`)
This seems to reproduce the issue with 100% consistency. I'm on both an unmodified Windows command prompt shell and Git Bash running MINGW64.
Will check it out later today, although it could likely be an issue with the upstream library we use for prompts, dialoguer.
I was able to recently reproduce this! For some reason, dialoguer does not handle graceful exits via SIGINT and does not send the required ANSI sequence to make the cursor visible. There's not much of a workaround other than manually emitting a show cursor ANSI sequence after your lune command, unfortunately.
Issue https://github.com/console-rs/dialoguer/issues/294 is relevant, and the workaround on lune's end would be to manually handle emitting the ANSI sequence upon SIGINT.