Fix length with user + clean zprofile

This commit is contained in:
François
2026-05-15 21:10:23 +02:00
parent 3803d38c1a
commit 575854e772
2 changed files with 7 additions and 3 deletions

View File

@@ -115,7 +115,7 @@ POWERLINE_STOP="\ue0b4"
POWERLINE_STOP_INV="\ue0b6"
PROMPT_ENTER="" #"\ueb70"
PROMPT_PAD="."
PROMPT_EXTRA_WIDTH=66
PROMPT_EXTRA_WIDTH=58
precmd() {
if [ -z ${STARTCMD_TS+x} ]; then
@@ -123,7 +123,8 @@ precmd() {
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}))
local u=$USER
prompt_ln=$((prompt_ln + ${#hn} + ${#u}))
if (($COLUMNS > PROMPT_EXTRA_WIDTH + prompt_ln)); then
local exec_ts=$(($(date +%s%N) - STARTCMD_TS))