From a1794de9f6bc90f2b3e98c492b0647ce803dd23e Mon Sep 17 00:00:00 2001 From: Timothy Sample Date: Wed, 8 Feb 2023 13:10:57 -0600 Subject: [PATCH] gash: Use a simple prompt on Mes. * gash/gash.scm [mes] (prompt): Use plain ol' "$". --- gash/gash.scm | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/gash/gash.scm b/gash/gash.scm index 5521e24..28f6da1 100644 --- a/gash/gash.scm +++ b/gash/gash.scm @@ -142,21 +142,25 @@ There is NO WARRANTY, to the extent permitted by law. (else (exit (run-repl (current-input-port) parse?)))))))) (thunk))) -(define prompt - (let* ((l (string #\001)) - (r (string #\002)) - (e (string #\033)) - (user (getenv "USER")) - (host (gethostname)) - (home (getenv "HOME"))) - (lambda () - (let* ((cwd (getcwd)) - (cwd (if (string-prefix? home cwd) - (string-replace cwd "~" 0 (string-length home)) - cwd))) - (string-append - l e "[01;32m" r user "@" host l e "[00m" r ":" - l e "[01;34m" r cwd l e "[00m" r (if (zero? (getuid)) "# " "$ ")))))) +(cond-expand + (mes (define (prompt) "$ ")) + (else + (define prompt + (let* ((l (string #\001)) + (r (string #\002)) + (e (string #\033)) + (user (getenv "USER")) + (host (gethostname)) + (home (getenv "HOME"))) + (lambda () + (let* ((cwd (getcwd)) + (cwd (if (string-prefix? home cwd) + (string-replace cwd "~" 0 (string-length home)) + cwd))) + (string-append + l e "[01;32m" r user "@" host l e "[00m" r ":" + l e "[01;34m" r cwd l e "[00m" r + (if (zero? (getuid)) "# " "$ ")))))))) (define (string-prefix s1 s2) (substring/read-only s1 0 (string-prefix-length s1 s2)))