faroncoder / advanced-shell-history

Automatically exported from code.google.com/p/advanced-shell-history
Apache License 2.0
0 stars 0 forks source link

Advanced Shell History http://code.google.com/p/advanced-shell-history/

Save your command line history in a sqlite3 DB!

Features of this utility:

HOW TO BUILD: $ make build_c # Builds the C++ version $ make build_python # Builds the Python version $ make build # Builds both versions

Notes:

HOW TO INSTALL: $ make install_c # Installs the C++ version $ make install_python # Installs the Python version $ make install # Installs both versions

HOW TO UNINSTALL: $ make uninstall

HOW DOES THIS WORK:

This program operates on the assumption that your shell gives you the ability to execute a custom operation before a prompt is redrawn on your terminal.

Bash provides the PROMPT_COMMAND environment variable while zsh gives us the precmd environment function. Both are repurposed by this program to log the previous command into a local database before each new prompt is displayed.

Many people have never heard of this feature or found a great use for it. However, if you currently DO use this feature, you can still use this program. The code renames your existing hook and invokes it after saving the previous command.

Caveats:

Bugs:

Author: cpa@google.com (Carl Anderson) Last Update: 2012-08-06