diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index cd934d0..53337c8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -146,7 +146,7 @@ fn run_command(raw: &ScopedRawMode, line: Vec<u8>) { None => todo!("homedir"), }; - if let Err(e) = std::env::set_current_dir(target) { + if let Err(_) = std::env::set_current_dir(target) { print!("ERR {PROMPT}"); } else { print!("{PROMPT}"); @@ -209,9 +209,11 @@ fn main() { // Enter b'\r' => { - print!("\r\n"); let line = line.dump(); - run_command(&raw, line); + if !line.is_empty() { + print!("\r\n"); + run_command(&raw, line); + } } // Backspace (127 on most systems) @@ -242,7 +244,7 @@ fn main() { move_cursor(Direction::Left, 1); line.left(); } - _ => {} + x => todo!("escape character {x}") } } } @@ -255,4 +257,7 @@ fn main() { } } } + + raw.disable(); + println!(); } |
