mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-18 18:31:59 +00:00
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
This commit is contained in:
parent
f85f501bcf
commit
605d76616a
1 changed files with 4 additions and 1 deletions
|
@ -3,7 +3,10 @@ function omz_history {
|
||||||
local clear list
|
local clear list
|
||||||
zparseopts -E c=clear l=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
|
# if -c provided, clobber the history file
|
||||||
echo -n >| "$HISTFILE"
|
echo -n >| "$HISTFILE"
|
||||||
fc -p "$HISTFILE"
|
fc -p "$HISTFILE"
|
||||||
|
|
Loading…
Reference in a new issue