Skip to content

Commit

Permalink
Add cmd history
Browse files Browse the repository at this point in the history
  • Loading branch information
adamperkowski committed Jul 28, 2024
1 parent 38fe3da commit c894670
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion shell/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#![warn(clippy::missing_safety_doc)]

extern crate alloc;
use alloc::{format, vec};
use alloc::{format, string, vec};

use bootloader::{entry_point, BootInfo};
use core::panic::PanicInfo;
Expand Down Expand Up @@ -60,13 +60,16 @@ pub fn init_kernel(boot_info: &'static BootInfo) {
fn kernel_main(boot_info: &'static BootInfo) -> ! {
init_kernel(boot_info);

let mut cmd_history: vec::Vec<string::String> = vec![];

loop {
let input = keyboard_buffer::read_buffer();

if input.ends_with("\n") {
keyboard_buffer::clear_buffer();

let mut args: vec::Vec<&str> = input.split(' ').collect();
cmd_history.push(input.replace("\n", ""));

if args[0] != "\n" {
let req_com = &args[0].replace("\n", "");
Expand Down

0 comments on commit c894670

Please sign in to comment.