Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Christian Salzmann-Jaeckel
tmux-resurrect
Commits
15cabbb9
Commit
15cabbb9
authored
Dec 27, 2018
by
*Kim Zick (rummik)
Browse files
Fixes for cmdline save/restore strategy
parent
edd8132b
Changes
2
Hide whitespace changes
Inline
Side-by-side
save_command_strategies/cmdline.sh
View file @
15cabbb9
...
...
@@ -13,7 +13,7 @@ exit_safely_if_empty_ppid() {
full_command
()
{
[[
-z
"
$CPID
"
]]
&&
exit
0
base64
/proc/
${
CPID
}
/cmdline
cat
/proc/
${
CPID
}
/cmdline
| perl
-ne
'print join(" ", map quotemeta, split(/\000/))'
|
base64
-w0
}
main
()
{
...
...
scripts/restore.sh
View file @
15cabbb9
...
...
@@ -293,13 +293,14 @@ restore_shell_history() {
restore_all_pane_processes
()
{
if
restore_pane_processes_enabled
;
then
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
dir
=
"
$(
remove_first_char
"
$dir
"
)
"
pane_full_command
=
"
$(
remove_first_char
"
$pane_full_command
"
)
"
if
base64
-d
<<<
$pane_full_command
>
/dev/null 2>&1
;
then
pane_full_command
=
$(
base64
-d
<<<
$pane_full_command
| perl
-ne
'print join(" ", map quotemeta, split(/\000/)), "\n"'
)
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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment