summary refs log tree commit diff stats
path: root/README.md
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2022-01-15 16:00:39 -0300
committerSoniEx2 <endermoneymod@gmail.com>2022-01-15 16:00:39 -0300
commit2ba539f3685d95e8535dbd3a7d389c69739f1061 (patch)
tree8e4d00407ace33e1b8d75fb0eaa2ae533d8834ea /README.md
Initial commit
Diffstat (limited to 'README.md')
-rw-r--r--README.md35
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.