diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..df5a92a --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +Bash Session +============ + +Bash Session is a small addition to one's bashrc that makes it easier to manage +bash history using the concept of "sessions". + +A session is simply a history file. The script provides the `session` function +to switch sessions/history files: it manages saving and loading the relevant +history files, as well as optionally switching the current directory. To +enable `cd` functionality, the `setsessioncwd` function is used. + +The `savecwd` function is provided as a convenience to store the current +directory as part of history, without automatically switching to it on session +load. + +By default, the script prepends the session to `PS1`. This can be overriden. + +Examples +-------- + +Using the script might look like this: + +``` +{@ default} soniex2@pc:~$ session blog +{@ blog} soniex2@pc:~/blog$ vim something.xhtml +{@ blog} soniex2@pc:~/blog$ deploy ... +{@ blog} soniex2@pc:~/blog$ session projectnew +{@ projectnew} soniex2@pc:~/blog$ mkdir ../projectnew && cd ../projectnew +{@ projectnew} soniex2@pc:~/projectnew$ setsessioncwd +... +{@ projectnew} soniex2@pc:~/projectnew$ exit +``` + +It can also be used with multiple shells. Note, however, that sessions aren't +synchronized across shells. |