reujab / silver

A cross-shell customizable powerline-like prompt with icons
MIT License
453 stars 30 forks source link

fixed cmdtime in zsh #21

Closed fresswolf closed 4 years ago

fresswolf commented 4 years ago

In zsh the cmdtime is calculated as the time diff between preexec() and the executed job when no actual command is executed. This led to the weird behaviour of displaying the time between prompts instead of execution time, which can be easily reproduced by just hitting enter in the prompt after some time, which then outputs the time passed since the last command (like 1h if you just press enter on an empty prompt after an hour) instead of a few ms. Setting SILVER_START before PROMPT in precmd() fixes that.