From b60aef689e3450dbb87388283c261b63e9c4fa68 Mon Sep 17 00:00:00 2001 From: George Chatzopoulos Date: Wed, 4 Nov 2026 07:38:53 +0200 Subject: [PATCH] Making it visible when in a devshell via a prefix to the PS1 --- metallaxis/modules/bash.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/metallaxis/modules/bash.nix b/metallaxis/modules/bash.nix index b088a5d..ad724d7 100644 --- a/metallaxis/modules/bash.nix +++ b/metallaxis/modules/bash.nix @@ -68,14 +68,20 @@ local TIME=$(date +%H:%M) local git_status=$(git_full_status) + # Devshell indicator + local DEV_PREFIX="" + if [[ -n "$DEV_SHELL_NAME" ]]; then + DEV_PREFIX="\[\033[1;36m\]($DEV_SHELL_NAME)\[\033[0m\] " + fi + if [ $EXIT -eq 0 ]; then - PS1="\[\033[0;90m\][$TIME]\[\033[0m\] \[\033[1;32m\]\u@\h\[\033[0m\]:\[\033[1;34m\]\w\[\033[1;33m\]$git_status\[\033[0m\] \$ " + PS1="$DEV_PREFIX\[\033[0;90m\][$TIME]\[\033[0m\] \[\033[1;32m\]\u@\h\[\033[0m\]:\[\033[1;34m\]\w\[\033[1;33m\]$git_status\[\033[0m\] \$ " else - PS1="\[\033[0;90m\][$TIME]\[\033[0m\] \[\033[1;32m\]\u@\h\[\033[0m\]:\[\033[1;34m\]\w\[\033[1;33m\]$git_status \[\033[1;31m\][ERR:$EXIT]\[\033[0m\] \$ " + PS1="$DEV_PREFIX\[\033[0;90m\][$TIME]\[\033[0m\] \[\033[1;32m\]\u@\h\[\033[0m\]:\[\033[1;34m\]\w\[\033[1;33m\]$git_status \[\033[1;31m\][ERR:$EXIT]\[\033[0m\] \$ " fi } PROMPT_COMMAND=__prompt_command ''; }; -} \ No newline at end of file +}