From f94ca6cfde13d0d0df6c65ff1a1267b4cf32bd2a Mon Sep 17 00:00:00 2001 From: Kamil Date: Mon, 20 Jun 2022 20:23:55 +0000 Subject: [PATCH] root/admin prompt is red now (#5836) I really miss bash's visual way of signalising root, i.e. blue: user, red: root So I brought it to nushell (since you've added `is-admin` the code is fully portable and easily-readable) and hope you'll like it --- docs/sample_config/default_env.nu | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/sample_config/default_env.nu b/docs/sample_config/default_env.nu index 2a460f4221..367c55247e 100644 --- a/docs/sample_config/default_env.nu +++ b/docs/sample_config/default_env.nu @@ -1,7 +1,11 @@ # Nushell Environment Config File def create_left_prompt [] { - let path_segment = ($env.PWD) + let path_segment = if (is-admin) { + $"(ansi red_bold)($env.PWD)" + } else { + $"(ansi green_bold)($env.PWD)" + } $path_segment }