cantino / mcfly

Fly through your shell history. Great Scott!
MIT License
6.78k stars 177 forks source link

Deleting a history entry on Zsh rewrites history file in Bash format #220

Closed vmax closed 2 years ago

vmax commented 2 years ago
  1. Let's say $HISTFILE contains these entries:
$ cat ~/.zsh_history
: 1641675734:0;ls -la
: 1641675848:0;cat ~/.zsh_history
  1. Press ^R to activate mcfly, select ls -la entry, press F2 to delete it and press ESC to exit out of mcfly

Expected result (zsh-style history preserved):

$ cat ~/.zsh_history
: 1641675848:0;cat ~/.zsh_history

Actual result (bash-style history is written back):

$ cat ~/.zsh_history
cat ~/.zsh_history

Next command executed (uname -a in the example) would be written in zsh style (with timestamp) again:

$ uname -a
...
$ cat ~/.zsh_history 
cat ~/.zsh_history
: 1641676115:0;uname -a