1
0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-12 19:18:28 +02:00

Only abbreviate $HOME at the beginning of cwd

Fixes #1150
This commit is contained in:
Wuestengecko 2019-02-01 17:43:52 +01:00 committed by GitHub
parent 5c7d1009de
commit 8f60309386
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -797,7 +797,7 @@ prompt_dir() {
# using $PWD instead of "$(print -P '%~')" to allow use of POWERLEVEL9K_DIR_PATH_ABSOLUTE
local current_path=$PWD # WAS: local current_path="$(print -P '%~')"
# check if the user wants to use absolute paths or "~" paths
[[ ${(L)POWERLEVEL9K_DIR_PATH_ABSOLUTE} != "true" ]] && current_path=${current_path//$HOME/"~"}
[[ ${(L)POWERLEVEL9K_DIR_PATH_ABSOLUTE} != "true" ]] && current_path=${current_path/#$HOME/"~"}
# declare all local variables
local paths directory test_dir test_dir_length trunc_path threshhold
# if we are not in "~" or "/", split the paths into an array and exclude "~"