You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The thread over in #320 made me realize what is wrong with bash history. It has two parts:
the history in the current shell process
the persisted history in the ~/.bash_history file
When you exit a process, it appends to the history file shopt -s histappend
This is really confusing because most people use multiple shells at once! Exiting a shell shouldn't cause more lines to appear in the history of another shell!
This is the expected model for GNU readline, and OSH inherits it, but shouldn't.
It's not clear what the solution is, but ideas are:
History could be stored in a unique file keyed by (PID, timestamp). Then all of them would have to be searched for recent commands?) (History being stored in a separate file for each pwd ameliorates the problem, but doesn't solve it.)
try doing file system tricks for atomic writes (note that network file systems don't always obey POSIX)
use an sqlite database (don't want this to be a required dependency)
Probably the answer is to let the user register a history callback, something better than PROMPT_COMMAND. Then the plugins can do what they want, like use an sqlite database or whatever, or use separate files per directory, etc.
The text was updated successfully, but these errors were encountered:
The thread over in #320 made me realize what is wrong with bash history. It has two parts:
~/.bash_history
fileWhen you exit a process, it appends to the history file
shopt -s histappend
This is really confusing because most people use multiple shells at once! Exiting a shell shouldn't cause more lines to appear in the history of another shell!
This is the expected model for GNU readline, and OSH inherits it, but shouldn't.
It's not clear what the solution is, but ideas are:
pwd
ameliorates the problem, but doesn't solve it.)Probably the answer is to let the user register a history callback, something better than
PROMPT_COMMAND
. Then the plugins can do what they want, like use an sqlite database or whatever, or use separate files per directory, etc.The text was updated successfully, but these errors were encountered: