Open nkartashov opened 8 years ago
You are probably right, I'll move it to Prefs. Will modify comments to be more descriptive.
Sorry for not fixing such trivial problems earlier, do you like how the code looks now?
One other thing you might want to think about is what the right behavior is when there's multiple sessions open at once; see for example: http://superuser.com/questions/211966/how-do-i-keep-my-bash-history-across-sessions You might want to append to the history file rather than just dumping the current session's history and overwriting everything else.
Up to you, and not necessary to do for this pull request.
We should indeed append instead of overwriting. Another bash reference
~@nkartashov I've added a preferences option, and implemented append-mode writing, in this branch: https://github.com/414owen/haskeline/tree/history-flushing-tweaks You're welcome to merge those changes into this pr~
Update: see https://github.com/judah/haskeline/pull/148
Previously command history was only flushed after the end of a session, this commit adds flushHistory function which performs the flushing and a flag to enforce flushing after every command.
Fixes issue #5
This change is