Skip to content
Permalink
Browse files

Don't Expand Prompt Function Outputs

A fix for #641
  • Loading branch information...
mmstick committed Dec 13, 2017
1 parent e81543b commit 29e64d768d321691d96a844fbfa4d58416cf752f
Showing with 4 additions and 5 deletions.
  1. +3 −4 src/shell/binary/prompt.rs
  2. +1 −1 src/shell/mod.rs
@@ -6,11 +6,10 @@ use sys;

pub(crate) fn prompt(shell: &mut Shell) -> String {
if shell.flow_control.level == 0 {
let rprompt = match prompt_fn(shell) {
match prompt_fn(shell) {
Some(prompt) => prompt,
None => shell.get_var_or_empty("PROMPT"),
};
expand_string(&rprompt, shell, false).join(" ")
None => expand_string(&shell.get_var_or_empty("PROMPT"), shell, false).join(" "),
}
} else {
" ".repeat(shell.flow_control.level as usize)
}
@@ -39,7 +39,7 @@ use parser::{ArgumentSplitter, Expander, Select};
use smallvec::SmallVec;
use std::env;
use std::fs::File;
use std::io::{self, Read, Write};
use std::io::{self, Read};
use std::iter::FromIterator;
use std::ops::Deref;
use std::path::Path;

0 comments on commit 29e64d7

Please sign in to comment.
You can’t perform that action at this time.