Fix wrong took when open terminal for the first time
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user