From 43773f10f94170adc24c7fa69a7f3afc7b71d337 Mon Sep 17 00:00:00 2001 From: Cyborus Date: Tue, 19 Dec 2023 13:58:35 -0500 Subject: [PATCH] fix key including newline when read from stdin --- src/auth.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/auth.rs b/src/auth.rs index 44bf7b8..1625414 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -36,7 +36,7 @@ impl AuthCommand { AuthCommand::AddKey { host, user, key } => { let key = match key { Some(key) => key, - None => crate::readline("new key: ").await?, + None => crate::readline("new key: ").await?.trim().to_string(), }; if keys.hosts.get(&user).is_none() { keys.hosts