aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md14
-rw-r--r--cdlog.sh6
2 files changed, 15 insertions, 5 deletions
diff --git a/README.md b/README.md
index 7e1909a..46f5e3d 100644
--- a/README.md
+++ b/README.md
@@ -50,11 +50,15 @@ pick which directory to change to or swap with. The terminal cursor is then
retraced back to the top of the menu, and the screen is erased from
that point to the bottom.
-* The `cdr` command is used for recovering previous sessions. It
-presents you with a numbered list of these sessions. You can recover to one of
-the sessions, use a `c` prefix on the number to clone the session into
-the current session, or press Enter to do nothing. Deleting unwanted
-sessions is possible with a `d` prefix.
+* The `cdr` command is used for recovering previous sessions.
+When `cdlog` started, it allocated a new session.
+The `cdr` recovery command presents you with a numbered list of previous
+sessions. You can recover to one of the sessions, use a `c` prefix on the number to clone
+the session into the current session, or press Enter to do nothing. Deleting
+unwanted sessions is possible with a `d` prefix. The `n` choice will select
+again the new session that `cdlog` had allocated on startup, and that one
+won't appear in the list of recoverable sessions unless it has been already
+persisted by the execution of a directory-changing command.
* The `cdalias` command is used for defining "cd aliases"; see below.
diff --git a/cdlog.sh b/cdlog.sh
index f3661f1..888a858 100644
--- a/cdlog.sh
+++ b/cdlog.sh
@@ -80,6 +80,7 @@ cdlog.init()
fi
cdlog_dirs=~/.cdlog.$context.dirs
+ cdlog_new_dirs=$cdlog_dirs
rm -f $cdlog_dirs
set -- ~/.cdlog.*.dirs
@@ -116,6 +117,7 @@ cdlog.recover()
printf "Use 1-%s to select context,\n" $i
printf "c1-c%s to clone,\n" $i
printf "d1-d%s to delete,\n" $i
+ printf "n to use newly allocated,\n" $i
fi
printf "or Enter to keep current context: "
read sel
@@ -140,6 +142,10 @@ cdlog.recover()
rm "$sel" && printf "Deleted!\n"
fi
;;
+ ( n )
+ cdlog_dirs=$cdlog_new_dirs
+ break
+ ;;
( "" )
break
;;