News for hackers. Stuff that matters.
Re:Show HN: tmux.sh by pyre on Saturday April 13, 2013 @07:07PM (#5545048)
This spawned from a thread[1] in the "Workflow in tmux" story[2]. There seemed to be a bunch of people that were frustrated because session grouping wasn't the default operating mode in tmux, so I whipped together this shell script that makes the behaviour the default.

[1] https://news.ycombinator.com/item?id=5542227

[2] https://news.ycombinator.com/item?id=5541401

Re:Show HN: tmux.sh by emmelaich on Sunday April 14, 2013 @02:33AM (#5546129)
BTW, this is beautifully tidy bit of shell programming.
Re:Show HN: tmux.sh by eddie_the_head on Saturday April 13, 2013 @07:42PM (#5545153)
Thanks, I was confused when tmux didn't act as gnu screen did when I first tried to use it for pair programming.
Re:Show HN: tmux.sh by maerten on Saturday April 13, 2013 @11:18PM (#5545735)
Nice, although tmux -S /tmp/pairprog and tmux -S /tmp/pairprog attach isn't that hard to type :-)
Re:Show HN: tmux.sh by pyre on Saturday April 13, 2013 @11:37PM (#5545787)
In this example, you are both connected to the same session. Each client can't focus on a separate window. It looks something like this:

         +-------------+
         | tmux server |
         +-------------+
            /
       +---------+
       | session |
       +---------+
        /       \ 
  +---------+ +---------+
  | client0 | | client1 |
  +---------+ +---------+
- `tmux server` is the 'backend' process listening on /tmp/pairprog

- `client0` and `client1` are the 'frontend' processes connecting to the socket /tmp/pairprog.

- `session` is the collection of windows that you are using.

The issue is that the currently active/focused window is an attribute of the session, meaning that all connected clients are always focused on the same window. What if you want to have each client focus on a separate window? This is behaviour that you get by default in screen, but you have to work a little more for in tmux.

The script is just a simple way to use session grouping, which would look like this:

         +-------------+
         | tmux server |
         +-------------+
            /        \
       +---------+ +-----------+
       | session |=| session-1 |
       +---------+ +-----------+
            |           |
       +---------+ +---------+
       | client0 | | client1 |
       +---------+ +---------+
Note the '=' between the sessions. I'm using this to denote that `session` and `session-1` are grouped, meaning that they share the same windows. Since each client is connected to a different session, they can switch windows independently.
Re:Show HN: tmux.sh by simcop2387 on Saturday April 13, 2013 @11:57PM (#5545833)
It's one reason I hadn't used tmux before, i couldn't figure out a nice way to get this. I love to use screen this way on multimonitor setups, and tmux's other windowing features would make this awesome.