Skip to content

Commit 1b63a94

Browse files
committed
Fix even more bugs in before last commit
First, increment the relevant indices in the awk statements regarding windows, as now the window_name entry exists. Second, remove the window_name entry from the dump_pane_contents and dump_shell_history functions as it no longer exists in the format.
1 parent 02a7f1f commit 1b63a94

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

scripts/restore.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ restore_grouped_sessions() {
355355
}
356356

357357
restore_active_and_alternate_windows() {
358-
awk 'BEGIN { FS="\t"; OFS="\t" } /^window/ && $5 ~ /[*-]/ { print $2, $4, $3; }' $(last_resurrect_file) |
358+
awk 'BEGIN { FS="\t"; OFS="\t" } /^window/ && $6 ~ /[*-]/ { print $2, $4, $3; }' $(last_resurrect_file) |
359359
sort -u |
360360
while IFS=$d read session_name active_window window_number; do
361361
tmux switch-client -t "${session_name}:${window_number}"

scripts/save.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,14 +259,14 @@ dump_state() {
259259
dump_pane_contents() {
260260
local pane_contents_area="$(get_tmux_option "$pane_contents_area_option" "$default_pane_contents_area")"
261261
dump_panes_raw |
262-
while IFS=$d read line_type session_name window_number window_name window_active window_flags pane_index dir pane_active pane_command pane_pid history_size; do
262+
while IFS=$d read line_type session_name window_number window_active window_flags pane_index dir pane_active pane_command pane_pid history_size; do
263263
capture_pane_contents "${session_name}:${window_number}.${pane_index}" "$history_size" "$pane_contents_area"
264264
done
265265
}
266266

267267
dump_shell_history() {
268268
dump_panes |
269-
while IFS=$d read line_type session_name window_number window_name window_active window_flags pane_index dir pane_active pane_command full_command; do
269+
while IFS=$d read line_type session_name window_number window_active window_flags pane_index dir pane_active pane_command full_command; do
270270
save_shell_history "$session_name:$window_number.$pane_index" "$pane_command" "$full_command"
271271
done
272272
}

0 commit comments

Comments
 (0)