mirror of
https://github.com/nushell/nushell.git
synced 2025-04-25 05:38:20 +02:00
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
This commit is contained in:
parent
fab3f8fd40
commit
f94ca6cfde
@ -1,7 +1,11 @@
|
|||||||
# Nushell Environment Config File
|
# Nushell Environment Config File
|
||||||
|
|
||||||
def create_left_prompt [] {
|
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
|
$path_segment
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user