mirror of
https://github.com/tmux-plugins/tmux-resurrect.git
synced 2024-11-21 20:08:48 +00:00
Restore grouped sessions
This commit is contained in:
parent
bfc625e13f
commit
5dc22a4a9b
@ -3,6 +3,7 @@
|
||||
### master
|
||||
- add link to the wiki page for "first pane/window issue" to the README as well
|
||||
as other tweaks
|
||||
- save and restore grouped sessions (used with multi-monitor workflow)
|
||||
|
||||
### v1.5.0, 2014-11-09
|
||||
- add support for restoring neovim sessions
|
||||
|
@ -183,6 +183,22 @@ restore_active_pane_for_each_window() {
|
||||
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() {
|
||||
awk 'BEGIN { FS="\t"; OFS="\t" } /^window/ && $5 ~ /[*-]/ { print $2, $4, $3; }' $(last_resurrect_file) |
|
||||
sort -u |
|
||||
@ -211,6 +227,7 @@ main() {
|
||||
# below functions restore exact cursor positions
|
||||
restore_active_pane_for_each_window
|
||||
restore_zoomed_windows
|
||||
restore_grouped_sessions
|
||||
restore_active_and_alternate_windows
|
||||
restore_active_and_alternate_sessions
|
||||
stop_spinner
|
||||
|
Loading…
Reference in New Issue
Block a user