Moving from Screen to Tmux

Posted by on October 2, 2011 at 6:46 pm.

I’ve been a long-time user of GNU Screen, as almost every person I know that spend a lot of time in a terminal.

I must admit I was happy, I really was. I was used to my workflow with 4 terminals 8×25 and a bunch of screens, with several nested-screens. I used awesome-wm before, so definitely I felt I wasn’t using all the space in my laptop screen (my laptop is a ThinkPad X61, so 1024×768 in a 12 inches-screen) but that was OK, after all my workflow was, well, good.

Until 2 days ago, I was told to try tmux, in fact, I was told «and why are you using screen? use tmux». As a daily-user of Screen my first reaction was «I’m used to», «I can use it as I want», and a lot of excuses for just not trying something new. But then I made a little research (on Google, of course). In about 30 minutes I ended up with a multiplexer working as I wanted and as I never got Screen to work. Finally I was using just a terminal and using all the space available in my tiny-laptop-screen and plus: saving a lot of bandwidth with my permanent SSH connection (a really big plus now that I’m living with a capped link to the net with a GSM-modem).

I changed the Ctrl-b shortcut to Ctrl-a (b is too far for using it with only one hand), configured so I could use nested tmux’es like screen when I push Ctrl-a a, activated visual monitoring and even got to use the tmux’s buffer along with my X11 buffer when I press Ctrl-a >!!

It’s all in my ~/.tmux.conf, use it at will. Later I will make a screencast about using tmux, so more people can get a working tmux easily.

ATM, I’m even more happy than I was with GNU Screen, so, any other recommendation, people?

  • https://www.google.com/accounts/o8/id?id=AItOawm1UfJ6HC_bTPlCbmCmd04tDGVlHGCGo6I klaernie

    What is this background? Does these colors serve some purpose?

    • http://www.joseluisrivas.net Jose Luis Rivas

      Yes, I love them and the purporse is keeping me happy :-)

  • http://joshtriplett.org/ Josh Triplett

    Can you elaborate a bit more on what tmux does for you that screen doesn’t?  You mentioned how you’ve configured tmux, and how you’ve transitioned from screen to tmux, but not what you can now do that you couldn’t before.

    • http://www.joseluisrivas.net Jose Luis Rivas

      Of course. If you see the snapshot I posted, you will see the fullscreen being used, all the pixels of my tiny-screen being used on-demand out-of-the-box.

      I love tmux’s panes, it helps me a lot while writing code. I used 4 terminals before, now is only one with the functionality of 4 or more, on demand.

  • Fred

    > Finally I was [...] saving a lot of bandwidth with my
    permanent SSH connection

    Can you explain  why tmux uses less bandwidth than screen? More efficient redrawing? Is the difference really measurable? How is it possible, since tmux also has TERM=screen, so applications should redraw the screen in the same way, shouldn’t they?

    • http://www.joseluisrivas.net Jose Luis Rivas

      For me the difference is significant. Instead of having 2, 3 or 4 SSH connections I’m using only one while programming with my workflow of at least 4 terminals open at the same terminal.

      They redraw in the same way, yes, but the savings happens when I’m using multiple panes on a same window. It means a lot to me because I’m connecting trough a GSM modem in a low-signal area.

  • hhanff

    > so, any other recommendation, people?
    http://www.tenshu.net/p/terminator.html

  • niol

    I couldn’t find this anywhere else, recovering a detached session if it exists or spawning a new one if there are none. I use this in my .bashrc . This is a bit equivalent to screen -RR && exit 0 .

    if [ -x `which tmux` ] && [ -z "$TMUX" ]; then
        if tmux ls 2> /dev/null | grep -v ‘(attached)$’; then
            tmux attach && exit 0
        else
            tmux -2 && exit 0
        fi
    fi

  • http://budiwijaya.net budiwijaya

    I’m a screen users too. Look’s like worth to try tmux. Thanks.

  • http://risca.no-ip.info Risca

    Haven’t you try jet BYOBU? That’s really cool, it is like an upper interface for screen (similar to what could be apt for dpkg) but much easier!
    For example:
    - install it on the server;
    - connect through SSH and launch byobu;
    - if you’ll press F2 you will get another console on the same ssh session, pressing F3/F4 you’ll move to the next/previous console.

    For more documentation look on google, it will let you do lot of staff.

  • Pingback: Move over screen, we have a new player in town « heimic.net