|
|
@ -571,8 +571,7 @@ prompt_custom() {
|
|
|
|
set_default POWERLEVEL9K_DIR_PATH_SEPARATOR "/"
|
|
|
|
set_default POWERLEVEL9K_DIR_PATH_SEPARATOR "/"
|
|
|
|
prompt_dir() {
|
|
|
|
prompt_dir() {
|
|
|
|
local current_path='%~'
|
|
|
|
local current_path='%~'
|
|
|
|
if [[ -n "$POWERLEVEL9K_SHORTEN_DIR_LENGTH" ]]; then
|
|
|
|
if [[ -n "$POWERLEVEL9K_SHORTEN_DIR_LENGTH" || "$POWERLEVEL9K_SHORTEN_STRATEGY" == "truncate_with_root_marker" ]]; then
|
|
|
|
|
|
|
|
|
|
|
|
set_default POWERLEVEL9K_SHORTEN_DELIMITER $'\U2026'
|
|
|
|
set_default POWERLEVEL9K_SHORTEN_DELIMITER $'\U2026'
|
|
|
|
|
|
|
|
|
|
|
|
case "$POWERLEVEL9K_SHORTEN_STRATEGY" in
|
|
|
|
case "$POWERLEVEL9K_SHORTEN_STRATEGY" in
|
|
|
@ -610,6 +609,20 @@ prompt_dir() {
|
|
|
|
current_path=$(truncatePathFromRight "$(pwd | sed -e "s,^$HOME,~,")" )
|
|
|
|
current_path=$(truncatePathFromRight "$(pwd | sed -e "s,^$HOME,~,")" )
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
|
|
|
|
truncate_with_root_marker)
|
|
|
|
|
|
|
|
local dir_truncate_root
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dir_truncate_root=$(upsearch $POWERLEVEL9K_ROOT_MARKER_FILE)
|
|
|
|
|
|
|
|
zero='%([BSUbfksu]|([FB]|){*})'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [[ "$dir_truncate_root" == "/" || "$dir_truncate_root" == "$HOME" ]]; then
|
|
|
|
|
|
|
|
current_path='%~'
|
|
|
|
|
|
|
|
elif [[ "$dir_truncate_root" == "$HOME"* ]]; then
|
|
|
|
|
|
|
|
current_path="~/$POWERLEVEL9K_SHORTEN_DELIMITER/${dir_truncate_root##*/}${PWD:${#${(S%%)dir_truncate_root//$~zero/}}}"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
current_path="/$POWERLEVEL9K_SHORTEN_DELIMITER/${dir_truncate_root##*/}${PWD:${#${(S%%)dir_truncate_root//$~zero/}}}"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
*)
|
|
|
|
current_path="%$((POWERLEVEL9K_SHORTEN_DIR_LENGTH+1))(c:$POWERLEVEL9K_SHORTEN_DELIMITER/:)%${POWERLEVEL9K_SHORTEN_DIR_LENGTH}c"
|
|
|
|
current_path="%$((POWERLEVEL9K_SHORTEN_DIR_LENGTH+1))(c:$POWERLEVEL9K_SHORTEN_DELIMITER/:)%${POWERLEVEL9K_SHORTEN_DIR_LENGTH}c"
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|