Skip to content

Commit 02a7f1f

Browse files
committed
Fix some of the errors in the last commit
First, make sure to include the ":" placeholder in the window_name format. Second, decrement the indices in relevant awk commands to make sure they point to the right items.
1 parent 6c9322a commit 02a7f1f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

scripts/restore.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ restore_window_properties() {
300300
}
301301

302302
restore_shell_history() {
303-
awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ { print $2, $3, $7, $10; }' $(last_resurrect_file) |
303+
awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ { print $2, $3, $6, $9; }' $(last_resurrect_file) |
304304
while IFS=$d read session_name window_number pane_index pane_command; do
305305
if ! is_pane_registered_as_existing "$session_name" "$window_number" "$pane_index"; then
306306
local pane_id="$session_name:$window_number.$pane_index"
@@ -321,7 +321,7 @@ restore_shell_history() {
321321
restore_all_pane_processes() {
322322
if restore_pane_processes_enabled; then
323323
local pane_full_command
324-
awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ && $11 !~ "^:$" { print $2, $3, $7, $8, $11; }' $(last_resurrect_file) |
324+
awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ && $10 !~ "^:$" { print $2, $3, $6, $7, $10; }' $(last_resurrect_file) |
325325
while IFS=$d read -r session_name window_number pane_index dir pane_full_command; do
326326
dir="$(remove_first_char "$dir")"
327327
pane_full_command="$(remove_first_char "$pane_full_command")"
@@ -331,15 +331,15 @@ restore_all_pane_processes() {
331331
}
332332

333333
restore_active_pane_for_each_window() {
334-
awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ && $9 == 1 { print $2, $3, $7; }' $(last_resurrect_file) |
334+
awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ && $8 == 1 { print $2, $3, $6; }' $(last_resurrect_file) |
335335
while IFS=$d read session_name window_number active_pane; do
336336
tmux switch-client -t "${session_name}:${window_number}"
337337
tmux select-pane -t "$active_pane"
338338
done
339339
}
340340

341341
restore_zoomed_windows() {
342-
awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ && $6 ~ /Z/ && $9 == 1 { print $2, $3; }' $(last_resurrect_file) |
342+
awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ && $5 ~ /Z/ && $8 == 1 { print $2, $3; }' $(last_resurrect_file) |
343343
while IFS=$d read session_name window_number; do
344344
tmux resize-pane -t "${session_name}:${window_number}" -Z
345345
done

scripts/save.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ window_format() {
5959
format+="${delimiter}"
6060
format+="#{window_index}"
6161
format+="${delimiter}"
62-
format+="#{window_name}"
62+
format+=":#{window_name}"
6363
format+="${delimiter}"
6464
format+="#{window_active}"
6565
format+="${delimiter}"

0 commit comments

Comments
 (0)