diff --git a/examples/basic.rs b/examples/basic.rs index 46dda42..3c8cd3a 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -3,13 +3,14 @@ use std::{thread, time::Duration}; use console::style; fn main() -> std::io::Result<()> { - // Set a no-op Ctrl-C handler so that Ctrl-C results in a - // `term.read_key()` error instead of terminating the process. You can skip + // Set a no-op Ctrl-C handler so that Ctrl-C results in + // `Esc` behavior because of a `term.read_key()` error + // instead of terminating the process. You can skip // this step if you have your own Ctrl-C handler already set up. // // We cannot (easily) handle this at the library level due to // https://github.com/Detegr/rust-ctrlc/issues/106#issuecomment-1887793468. - ctrlc::set_handler(move || {}).expect("Error setting Ctrl-C handler"); + ctrlc::set_handler(move || {}).expect("setting Ctrl-C handler"); cliclack::clear_screen()?; diff --git a/examples/basic_dynamic_items.rs b/examples/basic_dynamic_items.rs index b780a5d..7f79a4d 100644 --- a/examples/basic_dynamic_items.rs +++ b/examples/basic_dynamic_items.rs @@ -1,13 +1,8 @@ use console::style; fn main() -> std::io::Result<()> { - // Set a no-op Ctrl-C handler so that Ctrl-C results in a - // `term.read_key()` error instead of terminating the process. You can skip - // this step if you have your own Ctrl-C handler already set up. - // - // We cannot (easily) handle this at the library level due to - // https://github.com/Detegr/rust-ctrlc/issues/106#issuecomment-1887793468. - ctrlc::set_handler(move || {}).expect("Error setting Ctrl-C handler"); + // Set a no-op Ctrl-C to make it behave as `Esc` (see the basic example). + ctrlc::set_handler(move || {}).expect("setting Ctrl-C handler"); cliclack::clear_screen()?; diff --git a/examples/theme.rs b/examples/theme.rs index d95576a..7c785ea 100644 --- a/examples/theme.rs +++ b/examples/theme.rs @@ -22,13 +22,8 @@ impl Theme for MagentaTheme { } fn main() -> std::io::Result<()> { - // Set a no-op Ctrl-C handler so that Ctrl-C results in a - // `term.read_key()` error instead of terminating the process. You can skip - // this step if you have your own Ctrl-C handler already set up. - // - // We cannot (easily) handle this at the library level due to - // https://github.com/Detegr/rust-ctrlc/issues/106#issuecomment-1887793468. - ctrlc::set_handler(move || {}).expect("Error setting Ctrl-C handler"); + // Set a no-op Ctrl-C to make it behave as `Esc` (see the basic example). + ctrlc::set_handler(move || {}).expect("setting Ctrl-C handler"); set_theme(MagentaTheme);