blob: df5a92a6f254c8f5eb375ff7880def2f5c107879 (
plain) (
tree)
|
|
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.
|