cantino / mcfly

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

History lines are cleared when performing a search #107

Closed CreativeCactus closed 3 years ago

CreativeCactus commented 3 years ago

As the below shows, after performing a search (even if aborting), the $MCFLY_HISTORY file appears to be cleared, resulting in normal "history lines" navigation (up arrow) not working after the history -cr $MCFLY_HISTORY.

image

GNU bash, version 4.4.23(1)-release

cantino commented 3 years ago

That's odd, I've never seen that behavior.

kuehnelth commented 3 years ago

Hi, I have the same problem. I'm on bash version 5.1.4. Going back to mcfly version 0.5.1 or reverting commit 440249c9f1fe2a2e4fb58ef05de5ba265bb0d927 fixes the issue.

I think the ${READLINE_LINE[@]} > $MCFLY_HISTORY added by this commit should be ${READLINE_LINE[@]} >> $MCFLY_HISTORY instead. So it appends to the history file instead of overwriting it.

cantino commented 3 years ago

Thank you @kuehnelth, that makes sense!

cantino commented 3 years ago

I just pushed a fix to the repo— could you confirm that this fixes your bug @CreativeCactus?

Edit: and @kuehnelth!

cantino commented 3 years ago

Released in v0.5.3

kuehnelth commented 3 years ago

Thanks. Just installed it. Works fine now.

cantino commented 3 years ago

Thanks for checking!