I have been living with this issue quite some time now and recently came across this tracker which gave me some insight on what's going on. I am using hstr on the following platforms. | platform | shell | version | | :--: | :--: | :--: | | msys2 | bash | 5.2.37(2) | | Ubuntu 20.xx | bash | 5.0.17(1) | | Ubuntu 25.04 | bash | 5.2.37(1) | and I see that all of them exhibit the same exact behavior as described by this closes issue #386, so as a quick fix I removed [`history -r` insertion logic when its dirty](https://github.com/dvorka/hstr/blob/59f1b0da642b2dde69b0f2f4594fa2a28fb37713/src/hstr_history.c#L408) ```patch diff --git a/src/hstr_history.c b/src/hstr_history.c index adb55e6..184d997 100644 --- a/src/hstr_history.c +++ b/src/hstr_history.c @@ -405,7 +405,9 @@ int history_mgmt_remove_from_ranked(char *cmd, HistoryItems *history) { void history_mgmt_flush(void) { +#if 0 if(dirty && !is_zsh_parent_shell()) { fill_terminal_input("history -r\n", false); } +#endif } ``` looks like we have to mask this logic for `bash ver >= 5.x` shell as well not just `zsh` . _Originally posted by @123swk123 in https://github.com/dvorka/hstr/issues/386#issuecomment-2777592596_