Use a shortened dir path for window title

Also respect named directories
This commit is contained in:
Kovid Goyal 2021-07-16 17:49:21 +05:30
parent 2245d4506f
commit f4b3948168
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -72,8 +72,9 @@
if [[ "$_ksi_prompt[state]" == "first-run" ]]; then
_ksi_install_completion
fi
# Set kitty window title to the cwd
_ksi_set_title "${PWD/$HOME/~}"
# Set kitty window title to the cwd, appropriately shortened, see
# https://unix.stackexchange.com/questions/273529/shorten-path-in-zsh-prompt
_ksi_set_title $(print -P '%(4~|…/%3~|%~)')
# Prompt marking
if [[ "$_ksi_prompt[mark]" == "y" ]]; then