Unverified Commit 5dc22a4a authored by Bruno Sutic's avatar Bruno Sutic
Browse files

Restore grouped sessions

parent bfc625e1
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
### master ### master
- add link to the wiki page for "first pane/window issue" to the README as well - add link to the wiki page for "first pane/window issue" to the README as well
as other tweaks as other tweaks
- save and restore grouped sessions (used with multi-monitor workflow)
### v1.5.0, 2014-11-09 ### v1.5.0, 2014-11-09
- add support for restoring neovim sessions - add support for restoring neovim sessions
......
...@@ -183,6 +183,22 @@ restore_active_pane_for_each_window() { ...@@ -183,6 +183,22 @@ restore_active_pane_for_each_window() {
done done
} }
restore_grouped_session() {
local grouped_session="$1"
echo "$grouped_session" |
while IFS=$'\t' read line_type grouped_session original_session; do
TMUX="" tmux -S "$(tmux_socket)" new-session -d -s "$grouped_session" -t "$original_session"
done
}
restore_grouped_sessions() {
while read line; do
if is_line_type "grouped_session" "$line"; then
restore_grouped_session "$line"
fi
done < $(last_resurrect_file)
}
restore_active_and_alternate_windows() { restore_active_and_alternate_windows() {
awk 'BEGIN { FS="\t"; OFS="\t" } /^window/ && $5 ~ /[*-]/ { print $2, $4, $3; }' $(last_resurrect_file) | awk 'BEGIN { FS="\t"; OFS="\t" } /^window/ && $5 ~ /[*-]/ { print $2, $4, $3; }' $(last_resurrect_file) |
sort -u | sort -u |
...@@ -211,6 +227,7 @@ main() { ...@@ -211,6 +227,7 @@ main() {
# below functions restore exact cursor positions # below functions restore exact cursor positions
restore_active_pane_for_each_window restore_active_pane_for_each_window
restore_zoomed_windows restore_zoomed_windows
restore_grouped_sessions
restore_active_and_alternate_windows restore_active_and_alternate_windows
restore_active_and_alternate_sessions restore_active_and_alternate_sessions
stop_spinner stop_spinner
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment