You can shorten this to

   tmux attach || tmux new

Or in tmux git you can also use tmux new -A

-------- Original message --------
From: Fabio Coatti <fabio.coa...@gmail.com> 
Date: 24/09/2013  08:54  (GMT+00:00) 
To: tmux-users@lists.sourceforge.net 
Subject: tmux and resuming sessions 
 
Hi all,
some time ago I asked on this mailing list some way to emulate, with tmux, the 
same behaviour of screen -R (resume old session, if no sessions are present 
create a new one).

Now I found a page that shows some solutions (aliases) that basically works 
for me:

alias ltmux="if tmux has; then tmux attach; else tmux new; fi"



if anyone is searching for the same hint, just in case:

http://www.commandlinefu.com/commands/view/11612/alias-for-lazy-tmux-createreattach


--
Fabio

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to