On 20 February 2013 22:59, Anthony Molinaro <antho...@alumni.caltech.edu> wrote: > Hi, > > I was trying to figure out if there is a way to select a window by its > name programmatically. Specifically, I want a shell script that does > the following > > #!/bin/sh > > window=$1 > > if <some command to determine if the named window exists> ; then > <some command to connect to window> > else > tmux new-window -n $window > fi
tmux select-window -t some_window_name || tmux new-window -n ... The above assumes the current session, but -t accepts session identifiers as well. > But I still don't know if there's away to switch to a window by id. The > closest command I can find is select-window but that seems to only allow > selection by last, next and previous. No; you're misunderstanding how selections for session/windows/panes happens across tmux commands. -- Thomas Adam ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb _______________________________________________ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users