-
Notifications
You must be signed in to change notification settings - Fork 144
feat: add --interactive option to prompt for each change #1119
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,14 @@ fn run() -> proc_exit::ExitResult { | |
|
||
init_logging(args.verbose.log_level()); | ||
|
||
// HACK: Ensure the terminal gets reset to a good state if the user hits ctrl-c during a prompt | ||
// https://github.com/console-rs/dialoguer/issues/294 | ||
ctrlc::set_handler(move || { | ||
let _ = console::Term::stdout().show_cursor(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I now see the cursor but I can't see anything I type There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's strange, for me everything behaves normal after that change. |
||
std::process::exit(130); | ||
}) | ||
.expect("Failed to set handler for Ctrl+C needed to restore terminal defaults after killing the process"); | ||
|
||
if let Some(output_path) = args.dump_config.as_ref() { | ||
run_dump_config(&args, output_path) | ||
} else if args.type_list { | ||
|
@@ -289,6 +297,8 @@ fn run_checks(args: &args::Args) -> proc_exit::ExitResult { | |
&typos_cli::file::Identifiers | ||
} else if args.words { | ||
&typos_cli::file::Words | ||
} else if args.interactive { | ||
&typos_cli::file::Interactive | ||
} else if args.write_changes { | ||
&typos_cli::file::FixTypos | ||
} else if args.diff { | ||
|
Uh oh!
There was an error while loading. Please reload this page.