Save grouped sessions

Grouped sessions are session started with the command
`tmux new-session -t <existing-session-name>`

Those sessions share the panes and windows with the existing, original
session.
We're making sure to identify and save grouped sessions.
On the other hand, we don't want to save panes and windows twice
This commit is contained in:
Bruno Sutic
2015-02-09 02:11:35 +01:00
parent 3244b809eb
commit bfc625e13f
2 changed files with 71 additions and 6 deletions

View File

@ -3,6 +3,8 @@ resurrect_dir_option="@resurrect-dir"
SUPPORTED_VERSION="1.9"
d=$'\t'
# helper functions
get_tmux_option() {
local option="$1"
@ -54,6 +56,16 @@ save_bash_history_option_on() {
[ "$option" == "on" ]
}
get_grouped_sessions() {
local grouped_sessions_dump="$1"
export GROUPED_SESSIONS="${d}$(echo "$grouped_sessions_dump" | cut -f2 -d"${d}" | tr "\\n" "${d}")"
}
is_session_grouped() {
local session_name="$1"
[[ "$GROUPED_SESSIONS" == *"${d}${session_name}${d}"* ]]
}
# path helpers
resurrect_dir() {