diff --git a/src/repl.rs b/src/repl.rs index 9d29e4a..adaa62b 100644 --- a/src/repl.rs +++ b/src/repl.rs @@ -890,13 +890,18 @@ fn emoji(glyph: &str, style: &str, theme: &Theme, color: bool) -> String { } /// One-line status shown before every prompt, with colored emojis: -/// โš™ am v0.2.13 โ”‚ ๐Ÿ—‚๏ธ cwd โ”‚ 73 ๐Ÿค– ยท 12 ๐ŸŒ ยท 0 ๐Ÿ“Š โ”‚ โšก 97ms โ”‚ โฒ 32s -/// The last parameter is the duration of the previous command (None before -/// the first one). -fn print_status(app: &App, started: Instant, last: Option) { +/// โš™ am v0.2.13 ๐ŸชŸ bash โ”‚ ๐Ÿ—‚๏ธ cwd โ”‚ 73 ๐Ÿค– ยท 12 ๐ŸŒ ยท 0 ๐Ÿ“Š โ”‚ โšก 97ms โ”‚ โฒ 32s +/// `shell` is the active shell-gateway name (issue #44). The last parameter +/// is the duration of the previous command (None before the first one). +fn print_status(app: &App, started: Instant, last: Option, shell: &str) { let color = app.color(); let theme = app.theme(); let sep = dim(" โ”‚ ", theme, color); + let shell_part = format!( + "{} {}", + emoji("๐ŸชŸ", "cyan", theme, color), + dim(shell, theme, color) + ); let cwd = shorten_head(¤t_dir_string(), 30); let folder = format!( "{} {}", @@ -931,7 +936,7 @@ fn print_status(app: &App, started: Instant, last: Option) { color, ); println!( - "{}am v{}{sep}{folder}{sep}{counts}{sep}{last_part}{sep}{elapsed}", + "{}am v{}{sep}{shell_part}{sep}{folder}{sep}{counts}{sep}{last_part}{sep}{elapsed}", dim(" โš™ ", theme, color), env!("CARGO_PKG_VERSION"), ); @@ -1142,7 +1147,7 @@ fn run_with_editor(app: &App, session: &mut ShellSession, sid: &str) -> Result signal, Err(e) => { @@ -1231,7 +1236,7 @@ fn run_plain(app: &App, session: &mut ShellSession, sid: &str) -> Result { let mut last: Option = None; let mut last_duration: Option = None; loop { - print_status(app, started, last_duration); + print_status(app, started, last_duration, &session.current.name); eprint!("โฏ "); std::io::stderr().flush().ok(); let mut line = String::new();