Skip to content

[dotfiles-improvement] perf: replace $(date '+%H:%M:%S') with ZSH \$\{(%):-%D{}} in util.zsh - #557

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
fix/dotfiles-date-format-util-zsh-1785973976-ce4b2daedc86721f
Draft

[dotfiles-improvement] perf: replace $(date '+%H:%M:%S') with ZSH \$\{(%):-%D{}} in util.zsh#557
github-actions[bot] wants to merge 1 commit into
mainfrom
fix/dotfiles-date-format-util-zsh-1785973976-ce4b2daedc86721f

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Replace two $(date '+%H:%M:%S') subshell calls in wait-for-url (util.zsh) with the ZSH-native ${(%):-%D{%H:%M:%S}} prompt expansion.

Changes

File Before After
zsh/util.zsh (×2) $(date '+%H:%M:%S') ${(%):-%D{%H:%M:%S}}

Why

${(%):-%D{format}} is the ZSH-native way to format a timestamp:

  • (%) enables prompt-style expansion
  • %D{format} invokes strftime internally — no subshell, no date(1) fork

Same technique as the existing open PR #537 for other files.

No behavior change

The %H:%M:%S format specifiers are identical between date(1) and ZSH's strftime.

Generated by Dotfiles Improvement Scanner · ● 29.7M ·

Replace two $(date '+%H:%M:%S') subshell calls in wait-for-url with
the ZSH-native ${(%):-%D{%H:%M:%S}} prompt expansion.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants