From 63d97593c88330d2ab984681be913acf2d7099d9 Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Sun, 21 Dec 2025 17:46:15 +0000 Subject: Add distrobox to prompt --- zsh/config/prompt.zsh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'zsh/config/prompt.zsh') diff --git a/zsh/config/prompt.zsh b/zsh/config/prompt.zsh index 1a9776b..1034836 100644 --- a/zsh/config/prompt.zsh +++ b/zsh/config/prompt.zsh @@ -8,6 +8,18 @@ current_time() { echo "%{$fg[white]%}[%*]" } +container_l() { + if [[ -n "${CONTAINER_ID:-}" ]]; then + echo "%{$fg[cyan]%}*%{$reset_color%} " + fi +} + +container_r() { + if [[ -n "${CONTAINER_ID:-}" ]]; then + echo "(%{$fg[cyan]%}$CONTAINER_ID%{$reset_color%}) " + fi +} + return_status() { local LAST_EXIT_CODE=$? if [[ $LAST_EXIT_CODE -ne 0 ]]; then @@ -28,8 +40,8 @@ precmd() { VCS_STATUS="(%F{green}${vcs_info_msg_0_}%f) " fi fi - PROMPT='%B$(directory)%b %# %f' - RPROMPT='$(return_status)${VCS_STATUS}$(current_time)%f' + PROMPT='$(container_l)%B$(directory)%b %# %f' + RPROMPT='$(return_status)${VCS_STATUS}$(container_r)$(current_time)%f' } zstyle ':vcs_info:*' check-for-changes true -- cgit v1.2.3-70-g09d2