-
Notifications
You must be signed in to change notification settings - Fork 144
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 disappears when using SIGINT (ctrl-c). #77
Comments
I just have the same problem. This is reproduct code. ( fn main() {
if Confirm::new().with_prompt("Do you want to continue?").interact().unwrap() {
println!("Looks like you want to continue");
} else {
println!("nevermind then :(");
}
} |
@sirwindfield @s2terminal At the moment I'm working around this with a combination of the ctrlc::set_handler(move || {
let term = console::Term::stdout();
let _ = term.show_cursor();
})?; |
This is intentional. Ctrl-c and other stuff are not supposed to be handled by dialoguer when prompting. |
Fair enough. I was pretty sure that dialoguer did actually use ctrl-c handling but after checking the crates it seems that I was wrong :) I'll close this then. |
@sirwindfield Maybe it'd make sense to reopen this as a documentation issue to let people know of this limitation? IMO this should be documented in the front page of dialoguer. I recently hit it too with Ekleog/nixpkgs-check#20 |
No need to re-open. Documentation only changes are probably fine with a PR only :) I mean technically this issue is resolved. But I do agree that a notice inside the docs/readme would be good! |
Currently if you hit ctrlc while using the interactive menu, the cursor will not show up, the issue is not solved upstream console-rs/dialoguer#77 This is the available workaround
@pksunkara I understand
|
I use this crate over at https://github.com/SirWindfield/git-cm and a user opened an issue stating that after they press ctrl-c, their cursor disappears:
mainrs/git-cm#40
I think this is a bug/oversight inside of dialoguer or console and not my crate to be honest 🤔
The text was updated successfully, but these errors were encountered: