diff options
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 37 |
1 files changed, 4 insertions, 33 deletions
@@ -28,14 +28,15 @@ pub mod history; pub mod line; pub mod panic; pub mod parse; +pub mod ps1; pub mod raw; pub mod reload; pub mod run; pub mod rw; pub mod serialization; pub mod syntax_highlighting; -pub mod wait; pub mod variants; +pub mod wait; use raw::*; @@ -182,38 +183,8 @@ fn pretty_cwd() -> BString { } impl Session { - fn load_unevaled_prompt(&self) -> BString { - match self.vars.lookup(&b"PROMPT"[..]) { - Some(prompt) => prompt.into_owned(), - None => { - let mut prompt = BString::new(); - if cfg!(debug_assertions) { - prompt.push_all(b"dev "); - } - prompt.push_all(b"[$CWD_PRETTY]# "); - prompt - } - } - } - - fn prompt(this: Arc<Mutex<Self>>) -> BString { - let mut prompt = this.lock().unwrap().load_unevaled_prompt(); - let mut x = Vec::with_capacity(prompt.len() + 2); - x.push(b'"'); - x.append(&mut prompt); - x.push(b'"'); - let parsed = match crate::parse::ExpString::parse_from_bytes(&x) { - Ok(x) => x, - Err(e) => { - println!("{e:?}"); - return b"PARSE_ERROR$ ".to_vec(); - } - }; - let mut expander = run::Executor::new(this); - let Ok(expanded) = parsed.expand(&mut expander) else { - return b"EXEC_ERROR$ ".to_vec(); - }; - expanded + fn prompt(_this: Arc<Mutex<Self>>) -> BString { + todo!("replace with ps1 module"); } fn prompt_clear(&mut self) { |
