From b3a2a7bfeb0fac4005435a0ca7027be55d077258 Mon Sep 17 00:00:00 2001 From: Zoey Llewellyn Hewll Date: Sun, 1 Oct 2017 12:02:36 +0800 Subject: [PATCH] Ensure 'full' pwd-length always expands '~' Prompt-pwd's 'full' option always expands '~', as opposed to only expanding when '~' would be followed by other directories. This means the path is always in a consistent format, rather than alternating between expanded and condensed. --- modules/prompt/functions/prompt-pwd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/prompt/functions/prompt-pwd b/modules/prompt/functions/prompt-pwd index 53613e72..ebab583a 100644 --- a/modules/prompt/functions/prompt-pwd +++ b/modules/prompt/functions/prompt-pwd @@ -12,11 +12,11 @@ setopt localoptions extendedglob local current_pwd="${PWD/#$HOME/~}" local ret_directory -if [[ "$current_pwd" == (#m)[/~] ]]; then +if zstyle -m ':prezto:module:prompt' pwd-length 'full'; then + ret_directory=${PWD} +elif [[ "$current_pwd" == (#m)[/~] ]]; then ret_directory="$MATCH" unset MATCH -elif zstyle -m ':prezto:module:prompt' pwd-length 'full'; then - ret_directory=${PWD} elif zstyle -m ':prezto:module:prompt' pwd-length 'long'; then ret_directory=${current_pwd} else