a8f7f9f707ca5fb9ac7bedb088748b09db2fd3bd

Author
MoAlkhateeb <110918029+MoAlkhateeb@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

fix(history)!: fix arg passing to `fc` for `history` command (#12338)

BREAKING CHANGE: we have fixed a bug in the `history` wrapper for OMZ which means
that running just history will now not show all the history since the 1st command,
but only recent ones. To get the previous behavior, you can run `history 1` to get
all the command history, or other commands such as `history -30` to get the last
30 commands.

Diff

 1diff --git a/lib/history.zsh b/lib/history.zsh
 2index 7940769049f3031337fc54d9ce3c33ab4339b323..c39c8c8667b17d72d0735cd736881fa78d09324d 100644
 3--- a/lib/history.zsh
 4+++ b/lib/history.zsh
 5@@ -12,8 +12,8 @@ function omz_history {
 6     # if -l provided, run as if calling `fc' directly
 7     builtin fc "$@"
 8   else
 9-    # unless a number is provided, show all history events (starting from 1)
10-    [[ ${@[-1]-} = *[0-9]* ]] && builtin fc -l "$@" || builtin fc -l "$@" 1
11+    # otherwise, run `fc -l` with a custom format
12+    builtin fc -l "$@"
13   fi
14 }
15