Commit 02a7f1f9 authored by A Farzat's avatar A Farzat
Browse files

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.
parent 6c9322aa
...@@ -300,7 +300,7 @@ restore_window_properties() { ...@@ -300,7 +300,7 @@ restore_window_properties() {
} }
restore_shell_history() { restore_shell_history() {
awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ { print $2, $3, $7, $10; }' $(last_resurrect_file) | awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ { print $2, $3, $6, $9; }' $(last_resurrect_file) |
while IFS=$d read session_name window_number pane_index pane_command; do while IFS=$d read session_name window_number pane_index pane_command; do
if ! is_pane_registered_as_existing "$session_name" "$window_number" "$pane_index"; then if ! is_pane_registered_as_existing "$session_name" "$window_number" "$pane_index"; then
local pane_id="$session_name:$window_number.$pane_index" local pane_id="$session_name:$window_number.$pane_index"
...@@ -321,7 +321,7 @@ restore_shell_history() { ...@@ -321,7 +321,7 @@ restore_shell_history() {
restore_all_pane_processes() { restore_all_pane_processes() {
if restore_pane_processes_enabled; then if restore_pane_processes_enabled; then
local pane_full_command local pane_full_command
awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ && $11 !~ "^:$" { print $2, $3, $7, $8, $11; }' $(last_resurrect_file) | awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ && $10 !~ "^:$" { print $2, $3, $6, $7, $10; }' $(last_resurrect_file) |
while IFS=$d read -r session_name window_number pane_index dir pane_full_command; do while IFS=$d read -r session_name window_number pane_index dir pane_full_command; do
dir="$(remove_first_char "$dir")" dir="$(remove_first_char "$dir")"
pane_full_command="$(remove_first_char "$pane_full_command")" pane_full_command="$(remove_first_char "$pane_full_command")"
...@@ -331,7 +331,7 @@ restore_all_pane_processes() { ...@@ -331,7 +331,7 @@ restore_all_pane_processes() {
} }
restore_active_pane_for_each_window() { restore_active_pane_for_each_window() {
awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ && $9 == 1 { print $2, $3, $7; }' $(last_resurrect_file) | awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ && $8 == 1 { print $2, $3, $6; }' $(last_resurrect_file) |
while IFS=$d read session_name window_number active_pane; do while IFS=$d read session_name window_number active_pane; do
tmux switch-client -t "${session_name}:${window_number}" tmux switch-client -t "${session_name}:${window_number}"
tmux select-pane -t "$active_pane" tmux select-pane -t "$active_pane"
...@@ -339,7 +339,7 @@ restore_active_pane_for_each_window() { ...@@ -339,7 +339,7 @@ restore_active_pane_for_each_window() {
} }
restore_zoomed_windows() { restore_zoomed_windows() {
awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ && $6 ~ /Z/ && $9 == 1 { print $2, $3; }' $(last_resurrect_file) | awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ && $5 ~ /Z/ && $8 == 1 { print $2, $3; }' $(last_resurrect_file) |
while IFS=$d read session_name window_number; do while IFS=$d read session_name window_number; do
tmux resize-pane -t "${session_name}:${window_number}" -Z tmux resize-pane -t "${session_name}:${window_number}" -Z
done done
......
...@@ -59,7 +59,7 @@ window_format() { ...@@ -59,7 +59,7 @@ window_format() {
format+="${delimiter}" format+="${delimiter}"
format+="#{window_index}" format+="#{window_index}"
format+="${delimiter}" format+="${delimiter}"
format+="#{window_name}" format+=":#{window_name}"
format+="${delimiter}" format+="${delimiter}"
format+="#{window_active}" format+="#{window_active}"
format+="${delimiter}" format+="${delimiter}"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment