OK, here is what I did to replace screen -x:
function rsc() {
CLIENTID=$1.`date +%S`
tmux new-session -d -t $1 -s $CLIENTID \; set-option destroy-unattached
\; attach-session -t $CLIENTID
}
function mksc() {
tmux new-session -d -s $1
rsc $1
}
"mksc foo" creates a always detached permanent client named "foo". It also
calls "rsc foo" to create a client to newly created session. "rsc foo"
creates a new client grouped by "foo" name. It has destroy-unattached
turned on so when I leave it, it kills client.
Therefore, when my computer looses network connectivity, all
"foo.something" clients are killed while "foo" remains. I can then call
"rsc foo" to continue work from where I stopped.
This solves my problem. Thanks!
On Wed, Mar 28, 2012 at 02:58, Nicholas Marriott <
nicholas.marri...@gmail.com> wrote:
> destroy-unattached
>
>
> On Wed, Mar 28, 2012 at 12:51:08AM -0300, Igor Gatis wrote:
> > From tmux FAQ ([1]
> http://tmux.svn.sourceforge.net/viewvc/tmux/trunk/FAQ):
> > * How do I attach the same session to multiple clients but with a
> > different
> > * current window, like screen -x?
> > One or more of the windows can be linked into multiple sessions
> manually
> > with
> > link-window, or a grouped session with all the windows can be created
> with
> > new-session -t.
> > While using new-session -t approach I end up with so many unused
> sessions.
> > I've found*[2]http://mutelight.org/articles/practical-tmux*which has
> a
> > script to delete defunct sessions. This sounds like something tmux
> should
> > deal with.
> > Perhaps one could add an option named auto-kill-at-deattach which
> kills
> > sessions created with new-session -t after they are deattached. Auto
> kill
> > should not affect sessions created with new-session -s.*
> >
> > References
> >
> > Visible links
> > 1. http://tmux.svn.sourceforge.net/viewvc/tmux/trunk/FAQ
> > 2. http://mutelight.org/articles/practical-tmux
>
> >
> ------------------------------------------------------------------------------
> > This SF email is sponsosred by:
> > Try Windows Azure free for 90 days Click Here
> > http://p.sf.net/sfu/sfd2d-msazure
>
> > _______________________________________________
> > tmux-users mailing list
> > tmux-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/tmux-users
>
>
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users