fix hostname length

This commit is contained in:
François
2026-04-22 17:38:19 +02:00
parent 7a8bba1a73
commit 3803d38c1a

View File

@@ -115,13 +115,15 @@ POWERLINE_STOP="\ue0b4"
POWERLINE_STOP_INV="\ue0b6"
PROMPT_ENTER="" #"\ueb70"
PROMPT_PAD="."
PROMPT_EXTRA_WIDTH=73
PROMPT_EXTRA_WIDTH=66
precmd() {
if [ -z ${STARTCMD_TS+x} ]; then
STARTCMD_TS=$(date +%s%N)
fi
local prompt_ln="${#${${PWD}/${HOME}/~}}" # len of path where $HOME is susbtiued by ~ (and is counted as 1)
local hn=$(hostname)
prompt_ln=$((prompt_ln + ${#hn}))
if (($COLUMNS > PROMPT_EXTRA_WIDTH + prompt_ln)); then
local exec_ts=$(($(date +%s%N) - STARTCMD_TS))