diff --git a/src/main.rs b/src/main.rs index 4c8885b..64533f0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,5 @@ use std::{ - env::{current_dir, set_current_dir}, io::{self, Write}, path::{Component, Path, PathBuf}, process::Command + env::{current_dir, set_current_dir}, io::{self, Write}, path::PathBuf, process::Command }; use clap::Parser; @@ -28,7 +28,10 @@ fn main() { ); io::stdout().lock().flush().unwrap(); line.clear(); - io::stdin().read_line(&mut line).unwrap(); + if io::stdin().read_line(&mut line).unwrap() == 0 { + // EOF + return; + } let line = line.trim(); if line.is_empty() { continue;