From a8ea9c87d35b2ee571ed2fd0bd552a22ecb072ec Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Sun, 2 Jul 2023 23:24:12 -0400 Subject: [PATCH] Collapse hostname on Termux --- configs/zsh/prompt.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/configs/zsh/prompt.sh b/configs/zsh/prompt.sh index 1ae5fbe..915c345 100644 --- a/configs/zsh/prompt.sh +++ b/configs/zsh/prompt.sh @@ -12,7 +12,16 @@ else HOST_COLOR="green" fi -export PROMPT="%{$fg[$HOST_COLOR]%}%n@%M %{$fg[cyan]%}%~ $ %{$reset_color%}" +# Clear the prompt +export PROMPT="" + +# If we are *NOT* in Termux, show the host and username +if ! command -v termux-setup-storage; then + export PROMPT="%{$fg[$HOST_COLOR]%}%n@%M " +fi + +# Add the common prompt parts +export PROMPT="${PROMPT}%{$fg[cyan]%}%~ $ %{$reset_color%}" setopt prompt_subst autoload -Uz vcs_info zstyle ':vcs_info:*' actionformats \