cli: fix reading of client tunnel commands (#177919)

.read_line() appends to the string, so this caused the first command entered to always be read again
This commit is contained in:
Connor Peet 2023-03-21 16:33:28 -07:00 committed by GitHub
parent 94402be603
commit 349c62ab30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,6 +50,8 @@ pub async fn start_singleton_client(args: SingletonClientArgs) -> bool {
thread::spawn(move || {
let mut input = String::new();
loop {
input.truncate(0);
match std::io::stdin().read_line(&mut input) {
Err(_) | Ok(0) => return, // EOF or not a tty
_ => {}