diff --git a/client/src/main.rs b/client/src/main.rs index 3bc458c..7d51aaa 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -282,6 +282,7 @@ fn install( if opts.delete_invite || Confirm::with_theme(&*prompts::THEME) + .wait_for_newline(true) .with_prompt(&format!( "Delete invitation file \"{}\" now? (It's no longer needed)", invite.to_string_lossy().yellow() diff --git a/shared/src/prompts.rs b/shared/src/prompts.rs index 6832a1e..eb07938 100644 --- a/shared/src/prompts.rs +++ b/shared/src/prompts.rs @@ -47,6 +47,7 @@ pub fn add_cidr(cidrs: &[Cidr], request: &AddCidrOpts) -> Result if request.yes || Confirm::with_theme(&*THEME) + .wait_for_newline(true) .with_prompt(&format!("Delete CIDR \"{}\"?", cidr.name)) .default(false) .interact()? @@ -143,6 +145,7 @@ pub fn add_association(cidrs: &[Cidr]) -> Result, Error> Ok( if Confirm::with_theme(&*THEME) + .wait_for_newline(true) .with_prompt(&format!( "Add association: {} <=> {}?", cidr1.name.yellow().bold(), @@ -166,6 +169,7 @@ pub fn delete_association<'a>( Ok( if Confirm::with_theme(&*THEME) + .wait_for_newline(true) .with_prompt(&format!("Delete association #{}?", association.id)) .default(false) .interact()? @@ -226,6 +230,7 @@ pub fn add_peer( is_admin } else { Confirm::with_theme(&*THEME) + .wait_for_newline(true) .with_prompt(&format!("Make {} an admin?", name)) .default(false) .interact()? @@ -257,6 +262,7 @@ pub fn add_peer( Ok( if args.yes || Confirm::with_theme(&*THEME) + .wait_for_newline(true) .with_prompt(&format!("Create peer {}?", peer_request.name.yellow())) .default(false) .interact()? @@ -291,6 +297,7 @@ pub fn enable_or_disable_peer(peers: &[Peer], enable: bool) -> Result Result { println!("getting external IP address."); let external_ip = if Confirm::with_theme(&*THEME) + .wait_for_newline(true) .with_prompt("Auto-fill public IP address (using a DNS query to 1.1.1.1)?") .interact()? { @@ -417,6 +426,7 @@ pub fn override_endpoint(unset: bool) -> Result>, Error> Ok( if Confirm::with_theme(&*THEME) + .wait_for_newline(true) .with_prompt( &(if let Some(endpoint) = &endpoint { format!("Set external endpoint to {}?", endpoint)