Skip to content

Commit 2e33bbd

Browse files
committed
fix: change delimiter to avoid conflicts with empty values
1 parent cff343c commit 2e33bbd

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

scripts/helpers.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ RESURRECT_FILE_EXTENSION="txt"
1111
_RESURRECT_DIR=""
1212
_RESURRECT_FILE_PATH=""
1313

14-
d=$'\t'
14+
d=$'\t;\t'
1515

1616
# helper functions
1717
get_tmux_option() {

scripts/restore.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ source "$CURRENT_DIR/process_restore_helpers.sh"
88
source "$CURRENT_DIR/spinner_helpers.sh"
99

1010
# delimiter
11-
d=$'\t'
11+
d=$'\t;\t'
1212

1313
# Global variable.
1414
# Used during the restore: if a pane already exists from before, it is
@@ -306,7 +306,7 @@ restore_window_properties() {
306306
restore_all_pane_processes() {
307307
if restore_pane_processes_enabled; then
308308
local pane_full_command
309-
awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ && $11 !~ "^:$" { print $2, $3, $6, $8, $11; }' $(last_resurrect_file) |
309+
awk 'BEGIN { FS="\t;\t"; OFS="\t;\t" } /^pane/ && $11 !~ "^:$" { print $2, $3, $6, $8, $11; }' $(last_resurrect_file) |
310310
while IFS=$d read -r session_name window_number pane_index dir pane_full_command; do
311311
dir="$(remove_first_char "$dir")"
312312
pane_full_command="$(remove_first_char "$pane_full_command")"
@@ -316,15 +316,15 @@ restore_all_pane_processes() {
316316
}
317317

318318
restore_active_pane_for_each_window() {
319-
awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ && $9 == 1 { print $2, $3, $6; }' $(last_resurrect_file) |
319+
awk 'BEGIN { FS="\t;\t"; OFS="\t;\t" } /^pane/ && $9 == 1 { print $2, $3, $6; }' $(last_resurrect_file) |
320320
while IFS=$d read session_name window_number active_pane; do
321321
tmux switch-client -t "${session_name}:${window_number}"
322322
tmux select-pane -t "$active_pane"
323323
done
324324
}
325325

326326
restore_zoomed_windows() {
327-
awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ && $5 ~ /Z/ && $9 == 1 { print $2, $3; }' $(last_resurrect_file) |
327+
awk 'BEGIN { FS="\t;\t"; OFS="\t;\t" } /^pane/ && $5 ~ /Z/ && $9 == 1 { print $2, $3; }' $(last_resurrect_file) |
328328
while IFS=$d read session_name window_number; do
329329
tmux resize-pane -t "${session_name}:${window_number}" -Z
330330
done
@@ -340,7 +340,7 @@ restore_grouped_sessions() {
340340
}
341341

342342
restore_active_and_alternate_windows() {
343-
awk 'BEGIN { FS="\t"; OFS="\t" } /^window/ && $6 ~ /[*-]/ { print $2, $5, $3; }' $(last_resurrect_file) |
343+
awk 'BEGIN { FS="\t;\t"; OFS="\t;\t" } /^window/ && $6 ~ /[*-]/ { print $2, $5, $3; }' $(last_resurrect_file) |
344344
sort -u |
345345
while IFS=$d read session_name active_window window_number; do
346346
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
@@ -7,8 +7,8 @@ source "$CURRENT_DIR/helpers.sh"
77
source "$CURRENT_DIR/spinner_helpers.sh"
88

99
# delimiters
10-
d=$'\t'
11-
delimiter=$'\t'
10+
d=$'\t;\t'
11+
delimiter=$'\t;\t'
1212

1313
# if "quiet" script produces no output
1414
SCRIPT_OUTPUT="$1"

0 commit comments

Comments
 (0)