From 53c1a451c99ea7532dbde7dddbbfd39fa1f7998e Mon Sep 17 00:00:00 2001 From: Kirill Fedorov Date: Wed, 30 Apr 2025 17:34:14 +0300 Subject: [PATCH] fix(history): handle HIST_STAMPS with whitespace in timestamp format Correctly handle whitespace in custom history timestamp formats. Fixes an issue where spaces in HIST_STAMPS (e.g., "%y-%m-%d %T") caused errors by ensuring proper quoting when passing the format to `fc`. This resolves unintended parsing of timestamp components as invalid event specifiers. Closes #12365. --- lib/history.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/history.zsh b/lib/history.zsh index 35da57de2..781a0e9de 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -18,10 +18,10 @@ function omz_history { print -u2 History file deleted. elif [[ $# -eq 0 ]]; then # if no arguments provided, show full history starting from 1 - builtin fc $stamp -l 1 + builtin fc "${stamp[@]}" -l 1 else # otherwise, run `fc -l` with a custom format - builtin fc $stamp -l "$@" + builtin fc "${stamp[@]}" -l "$@" fi }