From 913f693f80467d0793267b3e63050af56f50b3ad Mon Sep 17 00:00:00 2001 From: "*Kim Zick (rummik)" Date: Fri, 28 Dec 2018 19:37:33 -0500 Subject: [PATCH] Remove cmdline dependency on base64 and perl --- save_command_strategies/cmdline.sh | 2 +- scripts/restore.sh | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/save_command_strategies/cmdline.sh b/save_command_strategies/cmdline.sh index 95cab3a..cf4edb5 100755 --- a/save_command_strategies/cmdline.sh +++ b/save_command_strategies/cmdline.sh @@ -13,7 +13,7 @@ exit_safely_if_empty_ppid() { full_command() { [[ -z "$CPID" ]] && exit 0 - cat /proc/${CPID}/cmdline | perl -ne 'print join(" ", map quotemeta, split(/\000/))' | base64 -w0 + cat /proc/${CPID}/cmdline | xargs -0 printf "%q " } main() { diff --git a/scripts/restore.sh b/scripts/restore.sh index d133a5f..27bdcc0 100755 --- a/scripts/restore.sh +++ b/scripts/restore.sh @@ -296,12 +296,9 @@ restore_all_pane_processes() { local save_command_strategy="$(get_tmux_option "$save_command_strategy_option" "$default_save_command_strategy")" local pane_full_command awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ && $11 !~ "^:$" { print $2, $3, $7, $8, $11; }' $(last_resurrect_file) | - while IFS=$d read 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")" pane_full_command="$(remove_first_char "$pane_full_command")" - if [ $save_command_strategy = "cmdline" ]; then - pane_full_command=$(base64 -d <<< $pane_full_command) - fi restore_pane_process "$pane_full_command" "$session_name" "$window_number" "$pane_index" "$dir" done fi