Is shell history an anachronism?
Tags: Developer ToolsI work in an environment that has user home directories shared over NFS. I always thought that kind of made the normal shell history mechanism fall on it’s face. None of the shells I’ve seen will actually do the hard work of synchronizing the shell history file to collect data from multiple different hosts in one file. It even falls apart when you have multiple term windows open on one machine. Many years ago I realized I didn’t want my shells writing frequently to my home directory over NFS, so I relocated my history file to /tmp. This means I’ll get history restored when I log into the same machine (until it gets rebooted) but it’s put luck which session on the same machine saved it’s history last. Bash is my normal shell these days, and it has a lot of features to tweak and manipulate the history, but none of the features seem to deal with the inherent sync issues. I suspect everyone uses history within their current shell session, and nobody much cares if it is saved or not.
The reason I care is because I’m looking at using it as a platform to associate command history with logical projects. It’s an interesting idea, but I’m surprised the whole mechanism is so poorly adapted to modern environments.