mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-12 20:21:02 +01:00
fix(history): fix confirmation prompt to allow bypass
See https://github.com/ohmyzsh/ohmyzsh/issues/12472#issuecomment-2171461005
This commit is contained in:
parent
373a1fd585
commit
c83ca51b1b
1 changed files with 2 additions and 3 deletions
|
@ -9,9 +9,8 @@ function omz_history {
|
||||||
|
|
||||||
# confirm action before deleting history
|
# confirm action before deleting history
|
||||||
print -nu2 "This action will irreversibly delete your command history. Are you sure? [y/N] "
|
print -nu2 "This action will irreversibly delete your command history. Are you sure? [y/N] "
|
||||||
builtin read -k1
|
builtin read
|
||||||
[[ "$REPLY" = $'\n' ]] || print -u2
|
[[ "$REPLY" = [yY] ]] || return 0
|
||||||
[[ "$REPLY" != ([yY]) ]] && return 0
|
|
||||||
|
|
||||||
print -nu2 >| "$HISTFILE"
|
print -nu2 >| "$HISTFILE"
|
||||||
fc -p "$HISTFILE"
|
fc -p "$HISTFILE"
|
||||||
|
|
Loading…
Reference in a new issue