mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2026-09-28 15:54:40 +00:00
Shorten dir path, if POWERLEVEL9K_SHORTEN_PWD_LENGTH is set.
This commit is contained in:
@@ -318,7 +318,13 @@ prompt_context() {
|
|||||||
|
|
||||||
# Dir: current working directory
|
# Dir: current working directory
|
||||||
prompt_dir() {
|
prompt_dir() {
|
||||||
$1_prompt_segment $0 blue $DEFAULT_COLOR '%~'
|
local current_path='%~'
|
||||||
|
if [[ -n "$POWERLEVEL9K_SHORTEN_PWD_LENGTH" ]]; then
|
||||||
|
# shorten path to $POWERLEVEL9K_SHORTEN_PWD_LENGTH characters
|
||||||
|
local current_path="%${POWERLEVEL9K_SHORTEN_PWD_LENGTH}<..<%~%<<"
|
||||||
|
fi
|
||||||
|
|
||||||
|
$1_prompt_segment $0 blue $DEFAULT_COLOR $current_path
|
||||||
}
|
}
|
||||||
|
|
||||||
# Command number (in local history)
|
# Command number (in local history)
|
||||||
|
|||||||
Reference in New Issue
Block a user