Skip to content

Commit

Permalink
fix: handle Ctrl-C in ciel new
Browse files Browse the repository at this point in the history
  • Loading branch information
eatradish committed Aug 6, 2024
1 parent 187a0bf commit f30b3c5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ sha2 = "0.10"
time = { version = "0.3", default-features = false, features = ["serde-human-readable", "macros"] }
fs3 = "0.5"
clap = { version = "^4", features = ["wrap_help", "string", "env"] }
ctrlc = "3.4.4"
# repo scan
ar = "0.9"
faster-hex = "0.9"
Expand Down
6 changes: 5 additions & 1 deletion src/actions/onboarding.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::{anyhow, Result};
use console::{style, user_attended};
use console::{style, user_attended, Term};
use dialoguer::{theme::ColorfulTheme, Confirm, Input};
use std::{fs, path::Path};

Expand All @@ -17,6 +17,10 @@ use super::{load_os, mount_fs};

/// Show interactive onboarding guide, triggered by issuing `ciel new`
pub fn onboarding(custom_tarball: Option<&String>, arch: Option<&str>) -> Result<()> {
ctrlc::set_handler(move || {
let _ = Term::stderr().show_cursor();
}).expect("Error setting Ctrl-C handler");

let theme = ColorfulTheme::default();
info!("Welcome to ciel!");
if Path::new(".ciel").exists() {
Expand Down

0 comments on commit f30b3c5

Please sign in to comment.