Skip to content

Commit

Permalink
fix(history): fix history -c (ohmyzsh#12362)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcornella authored and bean5 committed Apr 19, 2024
1 parent d307bb0 commit 9bf20fc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/history.zsh
Expand Up @@ -4,14 +4,14 @@ function omz_history {
local clear list stamp
zparseopts -E -D c=clear l=list f=stamp E=stamp i=stamp

if [[ $# -eq 0 ]]; then
# if no arguments provided, show full history starting from 1
builtin fc $stamp -l 1
elif [[ -n "$clear" ]]; then
if [[ -n "$clear" ]]; then
# if -c provided, clobber the history file
echo -n >| "$HISTFILE"
fc -p "$HISTFILE"
echo >&2 History file deleted.
elif [[ $# -eq 0 ]]; then
# if no arguments provided, show full history starting from 1
builtin fc $stamp -l 1
else
# otherwise, run `fc -l` with a custom format
builtin fc $stamp -l "$@"
Expand Down

0 comments on commit 9bf20fc

Please sign in to comment.