From 38297c2bf3a105bba071bfdef53755caa23a3772 Mon Sep 17 00:00:00 2001 From: Bruno Charest Date: Thu, 20 Aug 2026 08:35:27 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20prompt=20REPL=20=E2=80=94=20emoji=20?= =?UTF-8?q?=F0=9F=AA=9F=20+=20shell=20actif=20apr=C3=A8s=20la=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le statut avant chaque invite affiche maintenant le shell-gateway courant (ex: βš™ am v1.0.0 πŸͺŸ bash β”‚ ...), mis Γ  jour dynamiquement via 'shell '. VΓ©rifiΓ© en rΓ©el : bash β†’ pwsh aprΓ¨s switch. --- src/repl.rs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) 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();