Fixed restoring of alternate and active window for unnamed sessions

pull/430/head
scmanjarrez 2022-02-25 11:54:36 +01:00
parent 027960ad25
commit 3513855f09
1 changed files with 4 additions and 5 deletions

View File

@ -357,11 +357,10 @@ restore_grouped_sessions() {
}
restore_active_and_alternate_windows() {
awk 'BEGIN { FS="\t"; OFS="\t" } /^window/ && $6 ~ /[*-]/ { print $2, $4, $3; }' $(last_resurrect_file) |
sort -u |
while IFS=$d read session_name active_window window_number; do
tmux switch-client -t "${session_name}:${window_number}"
done
local active=$(awk 'BEGIN { FS="\t"; OFS="\t" } /^window/ && $6 ~ /\*/ { print $2":"$3; }' $(last_resurrect_file))
local alternate=$(awk 'BEGIN { FS="\t"; OFS="\t" } /^window/ && $6 ~ /-/ { print $2":"$3; }' $(last_resurrect_file))
tmux switch-client -t "$alternate"
tmux switch-client -t "$active"
}
restore_active_and_alternate_sessions() {