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
905abba3
Unverified
Commit
905abba3
authored
Dec 17, 2019
by
Bruno Sutic
Committed by
GitHub
Dec 17, 2019
Browse files
Merge pull request #283 from rummik/cmdline
Add cmdline save strategy
parents
1160c1da
2382467b
Changes
2
Show whitespace changes
Inline
Side-by-side
save_command_strategies/linux_procfs.sh
0 → 100755
View file @
905abba3
#!/usr/bin/env bash
CURRENT_DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
PANE_PID
=
"
$1
"
COMMAND_PID
=
$(
pgrep
-P
$PANE_PID
)
exit_safely_if_empty_ppid
()
{
if
[
-z
"
$PANE_PID
"
]
;
then
exit
0
fi
}
full_command
()
{
[[
-z
"
$COMMAND_PID
"
]]
&&
exit
0
cat
/proc/
${
COMMAND_PID
}
/cmdline | xargs
-0
printf
"%q "
}
main
()
{
exit_safely_if_empty_ppid
full_command
}
main
scripts/restore.sh
View file @
905abba3
...
...
@@ -299,7 +299,7 @@ restore_all_pane_processes() {
if
restore_pane_processes_enabled
;
then
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
"
)
"
restore_pane_process
"
$pane_full_command
"
"
$session_name
"
"
$window_number
"
"
$pane_index
"
"
$dir
"
...
...
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