mirror of
https://github.com/tmux-plugins/tmux-resurrect.git
synced 2025-09-10 21:23:09 +00:00
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:
@ -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() {
|
||||
|
Reference in New Issue
Block a user