Hacker News new | past | comments | ask | show | jobs | submit login

Is tmux a MacOS thing? I don't understand why would I want to use it on my machine. I already have a terminal multiplexer - it's called gnome-terminal and it supports tabs and multiple windows. Why would I want to add a clunky middle man with weird key combinations that messes with scrollback and colors?



>> I don't understand why would I want to use it on my machine. I already have a terminal multiplexer

I always feel the same way. I've got terminal set to open connections to 6 servers when I open it. I've tried using it, makes perfect sense to me, it's lovely, but I guess it just solves a problem I don't have? It's one of those many things that makes me feel like some kind of failure for some reason. Like using nano as my primary editor. I can use the hell out of emacs and vi, but for the work I do (I'm a sysadmin), most of the time nano just works, no weird issues, and it's always there. I know everyone is going to and laugh and me now, but there it is. I find myself using nano most of the time, though I'll use emacs a few times a week on some projects. Something about that long reach to the esc key keeps me away from vi.


When tmux might be handy:

If you find yourself doing repetitive things in those 6 windows. Say they are production machines that are basically clones of one another. It's simple to make a key binding that will force all 6 windows to, for example, "tail -f /var/log/messages". Or start "top" on all of them.

If you kick off a long running task (say a big build) in one of those six windows, and you leave it running, but go home and watch it finish. (detach/reattach). It's easier than stdout/stderr redirection, nohup, etc. It also preserves things you did manually (setting environment variables before the build) such that restarting a build might be less complex.

You have a peer, not close by, that you want to show how to do something. It has both read only and read/write session sharing. Your peer can watch what you're doing, or you can watch them, and take over when needed.


Definitely not a MacOS thing (though it runs well on OS X). OS X also comes with a terminal multipler - Terminal.app/iTerm 2.0 - but lots of people who work at the command line all day seem to like the keyboard support for multiple windows/sessions/panes that they get through tmux. The session persistence/reconnection is pretty nice for remote hosts as well.


The tmux/iterm2 integration on Macs doesn't make a lot of sense to me. Some people might be better served by moving to a platform with a tiling window manager.

The value depends on how you use your computer(s). If you are mostly working locally then something like gnome-terminal is fine. If you only ssh out to machines to run a handful of commands at a time you don't need it.

I can rent nice virtual machines anywhere in the world with great network connectivity and a lot of flexibility. Just about any computer can be used as a client. A secure shell and web browser is all I need most days.

I can detach from a session and reattach from another machine or even share a session with another person. Changing networks or machines or laptops sleeping doesn't cause everything in my session to get torn down and me having to set it up again. So for me the convenience outweighs the disadvantages. I don't run tmux on machines I only visit to do a bit of maintenance and I don't run it locally. And I only use a subset of the features regularly. But if I am working all day on a remote machine it is very practical.


It originated within the FreeBSD community (though it's not part of the project).

As to why you'd want it? I use it on machines I use remotely so I can have persistent sessions. That's the point of the likes of tmux and screen.

Also, gnome-terminal isn't a terminal multiplexer: it's a terminal emulator that allows you to open multiple terminal sessions in separate tabs. You're not multiplexing a single terminal in that case, unlike screen and tmux. If you want a terminal emulator that's more comparable to tmux and screen, take a look at Terminator: http://gnometerminator.blogspot.ie/p/introduction.html


For many people it will be the persistence of sessions on remote machines. I never use it remotely though and still love it, mainly because it's so easy to switch between windows and panes without having to use a mouse.


I used to love screen when I worked on a remote machine (no tmux on that machine, unfortunately). But it seems people are using it locally. Is it purely a matter of habit? In gnome-terminal, I'm switching between tabs with Ctrl-PgUp and Ctrl-PgDown and between windows with Alt-Tab. What can be easier than that?


Opening up panes on Tmux is pretty nice - Prefix-" or Prefix-% to get Horizontal or Vertical Panes. Copy/Paste Buffers are useful once you get the hang of them.

Also - once you master it - it doesn't really matter what system you are coming from - the interaction is the same. Windows, OS X, Linux, Heck - OpenBSD console - the interaction is the same.

I wouldn't be surprised if my Circa 1980 IBM 3101 Terminal is mostly supported by Tmux. (maybe a missing Meta Key, but that isn't used that much by Tmux)


You don't just get tabs (one full-screen/window terminal at a time). You can split it into multiple panes horizontally and vertically.

I think, for me, is that I'm also an emacs user. I never liked using the shell from emacs (I've seen people do it, it always felt clunky to me). So it's a similar configuration, but for more than just the things I use emacs for and running any tools/editors (I still use vim from time to time as well). When trying to understand some new (to me) program with a decent man/info page I can open up two panes side-by-side and review the documentation while playing around with the tool.

Another benefit, to me, is that I'm not always on the same OS (locally). So I use it a lot remotely, but it also means I'm not trying to use (on linux and OS X) two different terminal programs with different behaviors. Having a consistent environment (like I've also done with emacs, zsh, and to a lesser extent vim), makes switching between systems a breeze.


Well, beyond having to leave your home row and stretch for the PgUp/Down keys, it's nice not having to think about whether you're working on a local or remote machine, whether you're on a Windows machine in putty, on 127.0.0.1 with gnome-terminal/urxvt/xterm -- or given a proper setup, even whether you're using tmux or screen.

Creating new windows is the same command, switching between them is. And as others have mentioned, detaching processes without thinking about it beforehand (like you'd have to do if you start them with nohup/dtach).

Granted, the Xzibit-ness of it all grinds my wasted CPU cycle gears sometimes. Strangely enough, I haven't seen a setup where e.g. the X11 frontend just connects to a remote detachment & management daemon over ssh, so only one program is emulating ancient terminal hardware...


Not sure if I get exactly what you are looking for, but abduco[0] (with or without dvtm[1]) might serve you better.

[0]: http://www.brain-dump.org/projects/abduco/

[1]: http://www.brain-dump.org/projects/dvtm/


tmux can easily split windows vertically/horizontally. I'm not using gnome-terminal, so I don't know if it or your desktop environment makes splitting so quick.

I could also imagine using one window manager on remote systems and locally is just easier to remember.


Attach/detach is the killer feature if you ever use more than one computer in your workflow, i.e., if you're a programmer of any kind.


Your counterargument is a straw-man. If you wanted to use tmux, you'd set your own keys and spend a few minutes googling to fix the scrollback and colors. Tmux offers functionality that goes above and beyond the multiplexing built into most emulators.

Longtime users of tmux (like myself) find it elegant and speedy; not clunky.

I am also a linux user, but I can use an emulator with a much smaller footprint than yours and enjoy greater flexibility and control than you do.

Edit: see more positive version of this comment on adjacent thread: https://news.ycombinator.com/item?id=11411853


I had a similar thought for a long time, but then after watching a coworker I was convinced to give it a try.

I multitask a lot with multiple terminal windows, and what tmux buys you is similar to a tiling window manager with multiple desktops.

I used to spend a lot of time trying to figure out where I put terminal windows, and resizing them to a more ideal size for whatever I was working on at the moment.

Tmux allows you to have multiple (named) windows, each with multiple panes, that you can quickly rearrange, 'zoom', add to, separate, etc.

I find I get the most bang for my buck by setting the 'escape' key to simply `, instead of ctrl-a or ctrl-b. That way, window switching is simply `3, `1. `z maximizes or restores a window.

The problem with colors you mention is almost surely solved by simply launching tmux with '-2' as an argument.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: