Implemented assignments, working on job control

This commit is contained in:
2025-03-15 16:56:53 -04:00
parent 97b4b1835d
commit 2acf70ef96
25 changed files with 1390 additions and 280 deletions

View File

@@ -9,16 +9,16 @@ use rustyline::{error::ReadlineError, history::{FileHistory, History}, Config, E
use crate::{libsh::{error::ShResult, term::{Style, Styled}}, prelude::*};
fn init_rl<'s>() -> ShResult<'s,Editor<FernReadline,FernHist>> {
let hist = FernHist::default();
fn init_rl<'s>() -> ShResult<Editor<FernReadline,FileHistory>> {
let rl = FernReadline::new();
let config = Config::default();
let mut editor = Editor::with_history(config,hist)?;
let mut editor = Editor::new()?;
editor.set_helper(Some(rl));
editor.load_history(&Path::new("/home/pagedmov/.fernhist"))?;
Ok(editor)
}
pub fn read_line<'s>() -> ShResult<'s,String> {
pub fn read_line<'s>() -> ShResult<String> {
assert!(isatty(STDIN_FILENO).unwrap());
let mut editor = init_rl()?;
let prompt = "$ ".styled(Style::Green | Style::Bold);
match editor.readline(&prompt) {