Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can get that with bash with this config:

    # append to .bash_history and reread after each command
    export PROMPT_COMMAND="history -a;$PROMPT_COMMAND"
    # append to .bash_history instead of overwriting
    shopt -s histappend


Except that this doesn't save commands which haven't finished yet, and it never saves the current pending command when the shell is killed (e.g. the user closes the terminal window or logs out or the SSH connection is broken).

Sometimes the rare, long-running commands are the most valuable.

If I set up history software, it should preserve all history, and as early as possible.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: