This commit is contained in:
Ruize Tang 2024-10-05 05:36:22 +08:00 committed by GitHub
commit 1d21ad5106
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,6 +7,7 @@ function theme_precmd {
local promptsize=${#${(%):---(%n@%m:%l)---()--}}
local rubypromptsize=${#${(%)$(ruby_prompt_info)}}
local pwdsize=${#${(%):-%~}}
pwdsize=$(($pwdsize * 3 - ${#${(ml[$pwdsize * 2])${(%):-%~}}}))
# Truncate the path if it's too long.
if (( promptsize + rubypromptsize + pwdsize > TERMWIDTH )); then