diff --git a/keyfork/src/cli/wizard.rs b/keyfork/src/cli/wizard.rs index 90e7a3f..bfde049 100644 --- a/keyfork/src/cli/wizard.rs +++ b/keyfork/src/cli/wizard.rs @@ -1,6 +1,6 @@ use super::Keyfork; use clap::{Parser, Subcommand}; -use std::collections::HashSet; +use std::{collections::HashSet, io::IsTerminal}; use card_backend_pcsc::PcscBackend; use openpgp_card_sequoia::{state::Open, types::KeyType, Card}; @@ -99,6 +99,11 @@ fn generate_shard_secret(threshold: u8, max: u8, keys_per_shard: u8) -> Result<( let mut pm = PromptManager::new(std::io::stdin(), std::io::stderr())?; let mut certs = vec![]; let mut seen_cards: HashSet = HashSet::new(); + let stdout = std::io::stdout(); + assert!( + !stdout.is_terminal(), + "not printing shard to terminal, redirect output" + ); for index in 0..max { let cert = derive_key(&seed, index)?;