diff options
| author | MoAlkhateeb <110918029+MoAlkhateeb@users.noreply.github.com> | 2024-04-09 19:09:26 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-09 18:09:26 +0200 |
| commit | 605d76616aa47b2e5abe25eb26c4c9c1554f93d5 (patch) | |
| tree | 1fe63944e7a6eeee808c7e3faa8f56b2d733decd | |
| parent | f85f501bcf3dc771c64f4b2ec7609fc542d4d031 (diff) | |
| download | zsh-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
| -rw-r--r-- | lib/history.zsh | 5 |
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" |
