From 324a56d3f598f4aa776db26c4b36395edd547fe3 Mon Sep 17 00:00:00 2001 From: Martin Hans Date: Tue, 16 Apr 2024 15:27:00 +0200 Subject: [PATCH] Fix omz_history behave as used when HIST_STAMPS set. Introduce local stamp and catch options -f, -E and -i to it. --- lib/history.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/history.zsh b/lib/history.zsh index 56dda2462..2d3f28a3e 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -1,19 +1,19 @@ ## History wrapper function omz_history { - local clear list - zparseopts -E c=clear l=list + local clear list stamp + zparseopts -E -D c=clear l=list f=stamp E=stamp i=stamp if [[ $# -eq 0 ]]; then # if no arguments provided, show full history starting from 1 - builtin fc -l 1 + builtin fc $stamp -l 1 elif [[ -n "$clear" ]]; then # if -c provided, clobber the history file echo -n >| "$HISTFILE" - fc -p "$HISTFILE" + fc $stamp -p "$HISTFILE" echo >&2 History file deleted. elif [[ -n "$list" ]]; then # if -l provided, run as if calling `fc' directly - builtin fc "$@" + builtin fc $stamp "$@" else # otherwise, run `fc -l` with a custom format builtin fc -l "$@"