Skip to content
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

[BUG]: SIGINT during an stdio.prompt selection list hides terminal cursor #134

Open
TreehouseFalcon opened this issue Dec 7, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@TreehouseFalcon
Copy link

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.

@filiptibell filiptibell added the bug Something isn't working label Dec 10, 2023
@CompeyDev
Copy link
Contributor

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.

@TreehouseFalcon
Copy link
Author

TreehouseFalcon commented Feb 19, 2024

This bug happens on both Git Bash and the default Windows terminal program/command prompt.

@CompeyDev
Copy link
Contributor

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.

@TreehouseFalcon
Copy link
Author

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.

@CompeyDev
Copy link
Contributor

CompeyDev commented Feb 21, 2024

Will check it out later today, although it could likely be an issue with the upstream library we use for prompts, dialoguer.

@CompeyDev
Copy link
Contributor

CompeyDev commented Dec 24, 2024

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 console-rs/dialoguer#294 is relevant, and the workaround on lune's end would be to manually handle emitting the ANSI sequence upon SIGINT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants