summaryrefslogtreecommitdiff
path: root/lib/history.zsh
diff options
context:
space:
mode:
authorMoAlkhateeb <110918029+MoAlkhateeb@users.noreply.github.com>2024-04-09 19:09:26 +0300
committerGitHub <noreply@github.com>2024-04-09 18:09:26 +0200
commit605d76616aa47b2e5abe25eb26c4c9c1554f93d5 (patch)
tree1fe63944e7a6eeee808c7e3faa8f56b2d733decd /lib/history.zsh
parentf85f501bcf3dc771c64f4b2ec7609fc542d4d031 (diff)
downloadzsh-605d76616aa47b2e5abe25eb26c4c9c1554f93d5.tar.gz
zsh-605d76616aa47b2e5abe25eb26c4c9c1554f93d5.tar.bz2
zsh-605d76616aa47b2e5abe25eb26c4c9c1554f93d5.zip
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
Diffstat (limited to 'lib/history.zsh')
-rw-r--r--lib/history.zsh5
1 files changed, 4 insertions, 1 deletions
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"