From 605d76616aa47b2e5abe25eb26c4c9c1554f93d5 Mon Sep 17 00:00:00 2001 From: MoAlkhateeb <110918029+MoAlkhateeb@users.noreply.github.com> Date: Tue, 9 Apr 2024 19:09:26 +0300 Subject: [PATCH] fix(history): revert to old behavior when no args passed (#12341) * Fixed a bug in *omz_history* where it would automatically create a file when run with the -p flag * Reverted old history behaviour while fixing parsing bug --- lib/history.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/history.zsh b/lib/history.zsh index c39c8c866..56dda2462 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -3,7 +3,10 @@ function omz_history { local clear list zparseopts -E c=clear l=list - if [[ -n "$clear" ]]; then + if [[ $# -eq 0 ]]; then + # if no arguments provided, show full history starting from 1 + builtin fc -l 1 + elif [[ -n "$clear" ]]; then # if -c provided, clobber the history file echo -n >| "$HISTFILE" fc -p "$HISTFILE"