Skip to content

Commit 913f693

Browse files
committed
Remove cmdline dependency on base64 and perl
1 parent 15cabbb commit 913f693

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

save_command_strategies/cmdline.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ exit_safely_if_empty_ppid() {
1313

1414
full_command() {
1515
[[ -z "$CPID" ]] && exit 0
16-
cat /proc/${CPID}/cmdline | perl -ne 'print join(" ", map quotemeta, split(/\000/))' | base64 -w0
16+
cat /proc/${CPID}/cmdline | xargs -0 printf "%q "
1717
}
1818

1919
main() {

scripts/restore.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,9 @@ restore_all_pane_processes() {
296296
local save_command_strategy="$(get_tmux_option "$save_command_strategy_option" "$default_save_command_strategy")"
297297
local pane_full_command
298298
awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ && $11 !~ "^:$" { print $2, $3, $7, $8, $11; }' $(last_resurrect_file) |
299-
while IFS=$d read session_name window_number pane_index dir pane_full_command; do
299+
while IFS=$d read -r session_name window_number pane_index dir pane_full_command; do
300300
dir="$(remove_first_char "$dir")"
301301
pane_full_command="$(remove_first_char "$pane_full_command")"
302-
if [ $save_command_strategy = "cmdline" ]; then
303-
pane_full_command=$(base64 -d <<< $pane_full_command)
304-
fi
305302
restore_pane_process "$pane_full_command" "$session_name" "$window_number" "$pane_index" "$dir"
306303
done
307304
fi

0 commit comments

Comments
 (0)