From 2ba539f3685d95e8535dbd3a7d389c69739f1061 Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Sat, 15 Jan 2022 16:00:39 -0300 Subject: Initial commit --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 README.md (limited to 'README.md') 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. -- cgit 1.4.1