Restore grouped sessions

This commit is contained in:
Bruno Sutic 2015-02-09 02:25:50 +01:00
parent bfc625e13f
commit 5dc22a4a9b
No known key found for this signature in database
GPG Key ID: 66D96E4F2F7EF26C
2 changed files with 18 additions and 0 deletions

View File

@ -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

View File

@ -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() {
# 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