Open kaesluder opened 7 months ago
I thought ksh93 updated history files real time. The problem starts when you have multiple sessions open, for which I used a hack to incorporate the name of my current tty into the history file (which I would keep in a ~/.hist directory). Tricky bit was that ksh93 would require a restart to change the history file on startup.
What is the value of the HISTFILE you use? And do you have any other shells using that same file? Do they save in real time or on exit?
History file is set to $HOME/.kshrc_history
Aaaaand, now I can't reproduce the problem, although I did earlier today for u+m and u. I seem to remember having the same weirdness using ksh2020.
I tested it originally with only one ksh running. I'm running two interactive shells now and it looks like they're sharing history (and the line number on the prompt) with no issues. But as I said, I can't seem to break it following the same steps now.
I have not seen this happen since updating on OpenSUSE. Ticket can be closed.
I've been experimenting with implementing fzf history search, and found the following error if fc is called with an invalid argument. I've put in as close as I can get to a minimal example below. Calling fc with the output of $(history $HISTSIZE | fzf | cut -f1) renumbers history relative to a very large number. History resets if ksh is exited, sometimes clearing the history file, although I've not been able to reliably trigger tha.
Getting fzf running for this case is entirely optional. I'm more concerned about potential history and/or memory corruption.
Oops, forgot
version sh (AT&T Research) 93u+m/1.0.8 2024-01-01