Volker Kuhlmann wrote:
The problem is that the command histories are not
preserved. The .bash_history file contains the history
of whatever bash saved to it last before logout.


Yes, me too. :)

I use tcsh shell. The cwd is preserved, I expect this is done by konsole
as tcsh itself wouldn't have a clue about it (konsole looking into the
process table for the cwd info). The command history is preserved by
tcsh, and when saved, merged with the already saved content by use of a
time stamp (also saved). If I exit each shell manually, the history is
correctly saved. If I just exit KDE, none of the histories of any shell
is saved. I conclude that konsole kills the shells in such a way which
doesn't allow the shell to save its history. It's also possible that
tcsh has concurrency issues when saving histories, and that only the
history of the first shell to exit was saved, but I never noticed that
to be the one in which I did recent work. As you say it doesn't work any
better under bash, which makes it more likely a konsole issue. Verify
with xterm... Of course if bash can't merge histories at all, you're out
of luck.

bash is able to have a separate history file for each invocation. Konsole needs to be clever enough that, on logout, when it is told to save its state, it should get each bash to save its history in a separate file - and restore that history file to the appropriate bash next time the session is restored. I had a peek at the source code. I'm sure I could put it in there, if I had the time...


No freaking way am I going back to tcsh :-)

Cheers,
Carl.



Reply via email to