message: prompt now displays newlines correctly
diff: @@ -22,7 +22,7 @@ pub(crate) fn readln(shell: &mut Shell) -> Option<String> {
  .collect::<Vec<SmallString>>();
  loop {
  - let prompt = shell.prompt();
  + let prompt = handle_prompt(shell.prompt()).unwrap();
  let funcs = &shell.functions;
  let vars = &shell.variables;
  let builtins = &shell.builtins;
  @@ -166,3 +166,24 @@ fn complete_as_file(current_dir: PathBuf, filename: String, index: usize) -> boo
  // By default assume its not a file
  false
  }
  +
  +/// takes the input shell,
  +/// prints prompt info lines, and
  +/// returns the last prompt line.
  +fn handle_prompt(full_prompt: String) -> Result<String, String> {
  + if !full_prompt.contains("\n") {
  + return Ok(full_prompt)
  + }
  +
  + let stdout = io::stdout();
  + let mut handle = stdout.lock();
  + if let Err(why) =
  + handle.write(full_prompt.as_bytes()) {
  + return Err(format!("unable to print prompt info: {}", why));
  + }
  +
  + match full_prompt.lines().last() {
  + Some(prompt) => Ok(String::from(prompt)),
  + None => Err(format!("unable to get prompt"))
  + }
  +}
  