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
e99f1977
Commit
e99f1977
authored
Dec 28, 2018
by
*Kim Zick (rummik)
Browse files
Add mosh-client default strategy
parent
b020b248
Changes
3
Hide whitespace changes
Inline
Side-by-side
docs/restoring_programs.md
View file @
e99f1977
...
...
@@ -2,6 +2,7 @@
-
[
General instructions
](
#general-instructions
)
-
[
Clarifications
](
#clarifications
)
-
[
Working with NodeJS
](
#nodejs
)
-
[
Restoring Mosh
](
#mosh
)
### General instructions <a name="general-instructions"></a>
Only a conservative list of programs is restored by default:
<br/>
...
...
@@ -169,3 +170,10 @@ A work around, for this problem until it's fixed, is:
... node:node /path/to/yarn gulp "test-it"
### Restoring Mosh <a name="#mosh"></a>
Mosh spawns a
`mosh-client`
process, so we need to specify that as the process to be resurrected.
set -g @resurrect-processes 'mosh-client'
Additionally a mosh-client strategy is provided to handle extracting the original arguments and re-run Mosh.
resurrect.tmux
View file @
e99f1977
...
...
@@ -23,6 +23,7 @@ set_restore_bindings() {
set_default_strategies
()
{
tmux set-option
-gq
"
${
restore_process_strategy_option
}
irb"
"default_strategy"
tmux set-option
-gq
"
${
restore_process_strategy_option
}
mosh-client"
"default_strategy"
}
set_script_path_options
()
{
...
...
strategies/mosh-client_default_strategy.sh
0 → 100755
View file @
e99f1977
#!/usr/bin/env bash
# "mosh-client default strategy"
#
# Example mosh-client process:
# mosh-client -# charm tmux at | 198.199.104.142 60001
#
# When executed, the above will fail. This strategy handles that.
ORIGINAL_COMMAND
=
"
$1
"
DIRECTORY
=
"
$2
"
mosh_command
()
{
local
args
=
"
$ORIGINAL_COMMAND
"
args
=
"
${
args
#*-#
}
"
args
=
"
${
args
%|*
}
"
echo
"mosh
$args
"
}
main
()
{
echo
"
$(
mosh_command
)
"
}
main
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