Rosh is roaming shell. It can automatically reconnect to the host with the remote tmux or GNU screen session.
Add this line to your application's Gemfile:
gem 'rosh'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rosh
rosh [options] hostname [session_name]
-a alive-interval Set ssh option ServerAliveInterval. Default: 5
-e escape Set the escape charactor of the outer screen session.
Default: "^t"
-I interval Reconnection interval.
-S Use GNU screen instead of tmux
-L socket-name Specify tmux socket name (tmux -L socket-name)
If ~/.ssh/config contains LocalForward or RemoteForward for the host, the same
forwarding options are passed to ssh automatically.
If the host uses ProxyJump or ProxyCommand, rosh also carries that proxy
setting over to the spawned ssh command.
If a LocalForward is skipped because the local port is actually in use,
rosh retries that forwarding on later reconnect attempts instead of dropping it
for the rest of the process lifetime.
To detach the outer screen session,
^t d
To send the command to the inner screen session,
^a
Currently it is not configurable, but the source code is very simple to be customizable.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request