Sample Header Ad - 728x90

Command line history in the fish shell suffering from short term memory issues

5 votes
0 answers
690 views
Over the last few months, I've been trying out the fish shell as my interactive shell. One issue that somewhat irritates me is that the shell occasionally forgets recent commands from its command line history. Let's say I have a personal script in my $PATH called mail-get.sh. I can run it by typing its name on the command line and then recall the command at a later time by just typing get and pressing Up-arrow. Sometimes (a few times a day), the recall fails, and instead, I get _older_ commands that happen to contain the string get. The older command may be _several months_ older than the most recent invocation of my mail-get.sh script. Using history merge at that point always resolves the issue. Unfortunately, I can't reproduce the issue on purpose. I have not changed how fish should manage its history. My home directory is not network-mounted. I run several shell sessions in different tmux panes at the same time. I'm most heavily using fish version 3.5.1 on FreeBSD. My question is whether this is something that other users of the shell experience too, and whether it has a known cause and a convenient solution, or whether I should report it as a bug to the fish shell project. --- 2025 update: This is just to say that version 3.7.1 on Alpine Linux (the system I'm using the shell on most often nowadays) still exhibits the same behaviour. I see there are newer versions, 4.0.2 being the most recent. It will be interesting to test that once that version trickles down to the Unix I'm using.
Asked by Kusalananda (354278 rep)
Sep 8, 2022, 06:59 AM
Last activity: May 5, 2025, 05:44 PM