Closed btglr closed 2 years ago
Thanks @btglr. I don't use Fish. What's the best way to fix this?
Is there a reason you need HISTFILE to be set globally? I added set -e HISTFILE
(which erases the variable) to my Fish config as recommended in the issue I linked and everything still seems to work fine in regards to your plugin. Fish itself doesn't need that variable to be set.
I suspect that's cruft left over from the bash implementation that's not needed for fish.
As I think about it, this issue is likely to occur whenever you call one shell (without mcfly init code) inside a shell with mcfly init code. Not sure what the best solution is.
Do you mind seeing if https://github.com/cantino/mcfly/pull/204 fixes this for you?
Do you mind seeing if #204 fixes this for you?
I just tried it and it does fix the problem. Thanks!
Great, thanks for checking!
Released in 0.5.10.
As can be seen in this issue: https://github.com/fish-shell/fish-shell/issues/8349, 'corruption' of the
fish_history
file occurs when using mcfly with Fish. Due to HISTFILE being set globally withset -gx
: https://github.com/cantino/mcfly/blob/2daa339f0ee52c5e7b17321c3e64d1fe715d8d6d/mcfly.fish#L12 runningbash
inside a Fish shell using this plugin causes thebash
shell to inherit the HISTFILE variable which results in it being set to~/.local/share/fish/fish_history
instead of~/.bash_history
. Subsequently, bash starts writing in thefish_history
file which uses a different format and in turn breaks the history until manually fixed.