From 7a8bba1a73b7e12f749a561d199620b733c2d25f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Sun, 19 Apr 2026 19:55:04 +0200 Subject: [PATCH] Fix wrong took when open terminal for the first time --- private_dot_config/zsh/dot_zshrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/private_dot_config/zsh/dot_zshrc b/private_dot_config/zsh/dot_zshrc index 37ca165..2f6c8c5 100644 --- a/private_dot_config/zsh/dot_zshrc +++ b/private_dot_config/zsh/dot_zshrc @@ -118,7 +118,11 @@ PROMPT_PAD="." PROMPT_EXTRA_WIDTH=73 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) + if (($COLUMNS > PROMPT_EXTRA_WIDTH + prompt_ln)); then local exec_ts=$(($(date +%s%N) - STARTCMD_TS)) local seconds=$(echo "scale=9; $exec_ts / 1000000000" | bc)