Implemented prompt expansion

This commit is contained in:
2025-03-09 03:30:03 -04:00
parent 90a188d4b2
commit 58abe3bc3d
13 changed files with 430 additions and 23 deletions

View File

@@ -28,7 +28,8 @@ fn init_rl<'a>(shenv: &'a mut ShEnv) -> Editor<SynHelper<'a>, DefaultHistory> {
pub fn read_line(shenv: &mut ShEnv) -> ShResult<String> {
log!(TRACE, "Entering prompt");
let prompt = "$ ".styled(Style::Green | Style::Bold);
let ps1 = std::env::var("PS1").unwrap_or("\\$ ".styled(Style::Green | Style::Bold));
let prompt = expand_prompt(&ps1,shenv)?;
let mut editor = init_rl(shenv);
match editor.readline(&prompt) {
Ok(line) => {