Skip to content

Commit

Permalink
fix(history): revert to old behavior when no args passed (ohmyzsh#12341)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
MoAlkhateeb authored and cschuyle committed Apr 18, 2024
1 parent 8bb1aec commit 433ed5d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/history.zsh
Expand Up @@ -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"
Expand Down

0 comments on commit 433ed5d

Please sign in to comment.