Is there a way to make a modern shell's history feature be scoped to a path?
My working contexts are split up as paths on the file system, and the pattern of shell activity, such as repeatedly issued commands, tends to be distinct to each 'project'. It would be nice if I could scope the history feature to commands issued from the current path (or sub-path).
HISTFILE
. There's no reason to export it to other programs, and ~/.bashrc is executed for every interactive bash process, so your code for setting it is going to be run in every bash anyway. In general, if a shell-defined variable isn't exported by default, you rarely should export it. – Chris Page Jun 16 '15 at 05:26