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

IoError: read interrupted and messed-up terminal while using ctrl-c and a prompt is active #248

Open
hasezoey opened this issue Mar 7, 2023 · 2 comments · Fixed by console-rs/console#171

Comments

@hasezoey
Copy link

hasezoey commented Mar 7, 2023

when using either Input, Select or FuzzySelect (or maybe others) and also having ctrl-c setup and pushing CTRL+C while a prompt is active results in a IoError(Custom { kind: Interrupted, error: "read interrupted" }) and the terminal does not get reset (resulting in thing like no blinking cursor), and i also could not see a "cleanup" method that could be called manually to reset the terminal

fn main() {
  ctrlc::set_handler(move || { });
  
  dialoguer::Select::new() // while active, push CTRL+C
	.with_prompt("hello")
	.items(&["0", "1"])
	.interact()?;
}

system: Linux
console handler: Konsole (kde)
shell: zsh (oh-my-zsh)
dialoguer: 0.10.3
ctrl-c: 3.2.5
rust: 1.67.1

@pksunkara
Copy link
Collaborator

I am keeping this open until console lib is updated in this lib.

@pksunkara pksunkara reopened this May 21, 2023
@mitsuhiko
Copy link
Collaborator

Annoyingly this did not fully fix it. While the terminal is no longer fully messed up, the cursor is not coming back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants