Implemented cmd runtime expansion for the prompt
This commit is contained in:
@@ -28,6 +28,7 @@ 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");
|
||||
shenv.meta_mut().stop_timer();
|
||||
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);
|
||||
|
||||
@@ -13,9 +13,6 @@ pub fn check_delims(line: &str) -> bool {
|
||||
|
||||
while let Some(ch) = chars.next() {
|
||||
case_check.push(ch);
|
||||
if case_check.len() > 4 {
|
||||
case_check = case_check[1..].to_string();
|
||||
}
|
||||
if case_check.ends_with("case") {
|
||||
case_depth += 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user