[mosh-users] multiple sessions

C.v.St. stucki-spam at t-online.de
Fri Oct 11 15:01:57 EDT 2013


On 11.10.2013 20:25, Edison Lad wrote:
> Here is the alias I use  |alias ms='mosh jacob at myserver -- screen -dR'| to connect, and below is the error
This is a kind of classic problem.
You use alias=... with quotes which often does not what it seems
and also you always use -d for screen, which detaches the running session.
(And seemingly you expanded 'vb' instead of 'ms', so I do not know,
where the 'l' error might come from)

IF you do use bash or sh use functions instead of aliases, so qouting 
works as usual,
and make it two different functions for creating or reconnecting a screen.

The reconnect and start Functions would look like:

ms() {
   mosh jacob at myserver -- screen
}

mr() {
   mosh jacob at myserver -- screen -R
}

screen -d   DETACHES an already running session
screen -R   Reattaches to a running session
screen -x  looks into a running session (multipl windows seeing the same 
screen)

So your -dR detaches the session from where it was, and reattaches it 
'here',
which results in stealing the session.

If you want multiple mac-windows with one screen EACH, you need NO Option,
to let screen start new for each mosh.  BUT beware, when you have multiple
screens, you need the screens name to reconnect!  Then you need to do

1) screen -ls                        to show the running screen's names
2) screen  -r -S ...name...   to reconnect!

Therefore I always use only ONE 'screen' with many shells in it;
and if need be, I attach another window to the same 'screen' (-x).
One 'screen' can have 40 to 256 'ttys' to switch between!

Stucki



More information about the mosh-users mailing list