From fcb457efffd0798c09454c24a0fa628ba6041589 Mon Sep 17 00:00:00 2001 From: Yash Karandikar Date: Fri, 17 Sep 2021 13:09:20 -0500 Subject: [PATCH] Set move boundary to after the prompt --- src/interrupts.rs | 2 +- src/shell.rs | 14 ++++++++------ src/vga_buffer.rs | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/interrupts.rs b/src/interrupts.rs index e62ec1a..fa5e501 100644 --- a/src/interrupts.rs +++ b/src/interrupts.rs @@ -96,7 +96,7 @@ extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: InterruptStac let col = writer.column_position; let row = crate::vga_buffer::BUFFER_HEIGHT - 1; - if col != 0 { + if col != 4 { crate::vga_buffer::move_cursor((col as u16) - 1, row as u16); writer.column_position -= 1; } diff --git a/src/shell.rs b/src/shell.rs index 001df2f..7db225d 100644 --- a/src/shell.rs +++ b/src/shell.rs @@ -2,11 +2,13 @@ use crate::println; use crate::print; pub fn evaluate(command: &str) { - let res = command.trim(); - if res != "" { - println!(); - println!(); - println!("[ {:#?} ]", res); - print!(">>> "); + if let Some(stripped) = command.strip_prefix(">>> ") { + let res = stripped.trim(); + if res != "" { + println!(); + println!(); + println!("[ {} ]", res); + print!(">>> "); + } } } diff --git a/src/vga_buffer.rs b/src/vga_buffer.rs index ba717ec..064b9b3 100644 --- a/src/vga_buffer.rs +++ b/src/vga_buffer.rs @@ -157,7 +157,7 @@ pub fn backspace() { let row = BUFFER_HEIGHT - 1; let col = writer.column_position; let color_code = writer.color_code; - if col != 0 { + if col != 4 { writer.buffer.chars[row][col - 1].write(ScreenChar { ascii_character: b' ', color_code