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
7f506609
Unverified
Commit
7f506609
authored
Aug 27, 2014
by
Bruno Sutic
Browse files
User option for disabling pane process restoring
parent
cbf58ac6
Changes
3
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
7f506609
...
...
@@ -2,6 +2,7 @@
### master
-
restore pane processes
-
user option for disabling pane process restoring
### v0.0.4, 2014-08-26
-
restore pane layout for each window
...
...
scripts/helpers.sh
View file @
7f506609
# configurable constants
default_sessions_dir
=
"
$HOME
/.tmux/sessions"
sessions_dir_option
=
"@sessions-dir"
sessions_dir_option
=
"@session-saver-dir"
restore_processes_option
=
"@session-saver-restore-processes"
default_restore_processes
=
"true"
SUPPORTED_VERSION
=
"1.9"
...
...
scripts/session_restorer.sh
View file @
7f506609
...
...
@@ -105,14 +105,33 @@ restore_all_sessions() {
done
<
$(
last_session_path
)
}
restore_pane_processes_enabled
()
{
local
restore_processes
=
"
$(
get_tmux_option
"
$restore_processes_option
"
"
$default_restore_processes
"
)
"
if
[
$restore_processes
==
"false"
]
;
then
return
1
else
return
0
fi
}
restore_pane_process
()
{
local
pane_full_command
=
"
$1
"
local
session_name
=
"
$2
"
local
window_number
=
"
$3
"
local
pane_index
=
"
$4
"
tmux switch-client
-t
"
${
session_name
}
:
${
window_number
}
"
tmux send-keys
-t
"
$pane_index
"
"
$pane_full_command
"
"C-m"
}
restore_all_pane_processes
()
{
local
pane_full_command
awk
'BEGIN { FS="\t"; OFS="\t" } /^pane/ && $11 !~ "^:$" { print $2, $3, $7, $11; }'
$(
last_session_path
)
|
while
IFS
=
$'
\t
'
read
session_name window_number pane_index pane_full_command
;
do
pane_full_command
=
"
$(
remove_first_char
"
$pane_full_command
"
)
"
tmux switch-client
-t
"
${
session_name
}
:
${
window_number
}
"
tmux send-keys
-t
"
$pane_index
"
"
$pane_full_command
"
"C-m"
done
if
restore_pane_processes_enabled
;
then
local
pane_full_command
awk
'BEGIN { FS="\t"; OFS="\t" } /^pane/ && $11 !~ "^:$" { print $2, $3, $7, $11; }'
$(
last_session_path
)
|
while
IFS
=
$'
\t
'
read
session_name window_number pane_index pane_full_command
;
do
pane_full_command
=
"
$(
remove_first_char
"
$pane_full_command
"
)
"
restore_pane_process
"
$pane_full_command
"
"
$session_name
"
"
$window_number
"
"
$pane_index
"
done
fi
}
restore_pane_layout_for_each_window
()
{
...
...
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