Make path separator configurable for dir prompt

Now the path separator can be configured by setting
`POWERLEVEL9K_DIR_PATH_SEPARATOR`
This commit is contained in:
Dominik Ritter 2016-11-29 22:58:19 +01:00
parent 7a776dc68c
commit a1b4d44755
1 changed files with 5 additions and 0 deletions

View File

@ -456,6 +456,7 @@ prompt_custom() {
}
# Dir: current working directory
set_default POWERLEVEL9K_DIR_PATH_SEPARATOR "/"
prompt_dir() {
local current_path='%~'
if [[ -n "$POWERLEVEL9K_SHORTEN_DIR_LENGTH" ]]; then
@ -503,6 +504,10 @@ prompt_dir() {
esac
fi
if [[ "${POWERLEVEL9K_DIR_PATH_SEPARATOR}" != "/" ]]; then
current_path=$(echo "${current_path}" | sed "s/\//${POWERLEVEL9K_DIR_PATH_SEPARATOR}/g")
fi
typeset -AH dir_states
dir_states=(
"DEFAULT" "FOLDER_ICON"