Function prompt_customIcon is slower than it could be (due to forking) and isn't quite correct. Here's a fixed version:
prompt_customIcon
function prompt_customIcon() { local -i currenttime=${(%):-%D{%H%M}} if (( currenttime > 1619 || currenttime < 421 )); then ... else ... fi }
It's also a very good idea to prefix all your custom prompt segments with my_ to avoid clashes with future versions of powerlevel10k.
my_
function prompt_my_icon() { ... }
Thanks for the tip! What do you mean by forking?
It calls an external command (date), which is implemented as fork + exec. Both of these calls are very expensive and slow.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Function
prompt_customIcon
is slower than it could be (due to forking) and isn't quite correct. Here's a fixed version:It's also a very good idea to prefix all your custom prompt segments with
my_
to avoid clashes with future versions of powerlevel10k.Thanks for the tip! What do you mean by forking?
It calls an external command (date), which is implemented as fork + exec. Both of these calls are very expensive and slow.