Skip to content

Commit a96283d

Browse files
show-previous-run-time-of-the-command
1 parent f8da07e commit a96283d

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

airootfs/root/.config/starship.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ $time\
1616
[ ](fg:#1d2230)\
1717
\n▶▶ """
1818

19+
# have to make the changes in the 2nd line regarding the icon (where have to replace the linux to tcet)
20+
21+
# -------
1922
[directory]
2023
style = "fg:#e3e5e5 bg:#769ff0"
2124
format = "[ $path ]($style)"

airootfs/root/.zshrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,3 +241,17 @@ eval "$(mcfly init zsh)"
241241
## Run neofetch
242242
#neofetch
243243

244+
# Show time to the user which was the last executed code
245+
function preexec() {
246+
timer=$(($(date +%s%0N)/1000000))
247+
}
248+
249+
function precmd() {
250+
if [ $timer ]; then
251+
now=$(($(date +%s%0N)/1000000))
252+
elapsed=$(($now-$timer))
253+
254+
export RPROMPT="%F{cyan}${elapsed}ms %{$reset_color%}"
255+
unset timer
256+
fi
257+
}

0 commit comments

Comments
 (0)