diff options
| -rw-r--r-- | src/main.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 53337c8..3017995 100644 --- a/src/main.rs +++ b/src/main.rs @@ -130,7 +130,9 @@ pub struct CursorPos { const PROMPT: &str = "> "; fn run_command(raw: &ScopedRawMode, line: Vec<u8>) { - let words: Vec<&[u8]> = line.split(|x| *x == b' ').collect(); + let mut words: Vec<&[u8]> = line.split(|x| *x == b' ').collect(); + words.retain(|w| !w.is_empty()); + if words.is_empty() { print!("{PROMPT}"); return; |
