Live data from Hacker News

Tools I Use - tmux

rdegges.com

1–10 of 61 posts

Re: Tools I Use - tmux

#3
I used screen for 15 years but recently switched because I liked tmux's easy-to-read conf file and scriptability.

Mac OS X users watch out, launchctl commands barf mysteriously inside of tmux.

Re: Tools I Use - tmux

#4
There are multiple problems with tmux on OS X. pbcopy and pbpaste, for instance, are entirely unusable. Even if tmux has some nice benefits over screen, it probably isn't worth it to the Mac user to switch.

Re: Tools I Use - tmux

#5
what i like about tmux: - its actually faster than screen to startup - all the stuff everyone lists/knows/blog post

what i dont like about tmux: - it schokes on some weirdo programs while screen seems pretty reliable on anything

thus i end up on screen more often than not

Re: Tools I Use - tmux

#6
post #5

what i like about tmux: - its actually faster than screen to startup - all the stuff everyone lists/knows/blog post what i dont like about tmux: - it schokes on some weirdo programs while screen seems pretty reliable on anything thus i end up on screen more often than not

Try modifying your TERM environment variable, I've found it can be quite sensitive to that.

Re: Tools I Use - tmux

#7
post #4

There are multiple problems with tmux on OS X. pbcopy and pbpaste, for instance, are entirely unusable. Even if tmux has some nice benefits over screen, it probably isn't worth it to the Mac user to switch.

There's a similar-sounding problem in the X11 environment on traditional Unix systems: the current default graphical display is in the $DISPLAY environment variable, while authentication information is in ~/.Xauthority. GNU Screen tends to blindly inherit those settings, so you can freely start GUI apps from inside screen and have everything work... until you try to reattach screen from inside a different GUI session, or from a non-GUI session (say, ssh). Then all the processes you run inside screen go looking for a GUI session that no longer exists and everything starts breaking in odd ways.

tmux actually has a way to work around this: whenever you reattach, it looks at a whitelist of environment variables representing external resources, and either updates its own environment with the new values, or removes those settings from its environment if the place you're attaching from doesn't have them available (naturally this doesn't magically fix any processes already running inside tmux, but every new window you create will be set up correctly - unlike screen, where you have to kill every window and end the session). By defaut, this whitelist includes variables used for X11 authentication and the SSH agent. If OS X has a similar environment-variable-based connection system, you might be able to add it to tmux to get things working.

Re: Tools I Use - tmux

#8
Some other cool features:

Monitoring background windows: with monitor-activity, monitor-silence, and monitor-content [term], you get a visual notification when there is activity, a certain period of silence, or an occurrence of [term], respectively, in a specified background window. Sometimes I open several error logs in a background window and monitor-activity so I get a notification if anything is written.

synchronize-content: I've only used this a few times but it's a neat trick! With several panes open in one window you can send keystrokes to all the panes at once. I've used this while connected to more than one server to compare the contents or make changes simultaneously. I won't claim this is the safest way to work but it comes in handy.

Managing windows and panes in tmux is pretty painless, in my experience. Resizing, switching, etc. are all very simple. One final feature I like, tho it's trivial, is the "show the time" command (bound to prefix-t). Invoking it gives you a nice big digital clock in a window or pane. I put this below my ttytter pane so I don't lose track of time. :)

I don't know how much of this you can do in screen as I've never used it, I'm sure there's a lot of overlap, but as a sometimes very critical software user let me say: I love tmux.

Re: Tools I Use - tmux

#9
post #4

There are multiple problems with tmux on OS X. pbcopy and pbpaste, for instance, are entirely unusable. Even if tmux has some nice benefits over screen, it probably isn't worth it to the Mac user to switch.

You can use this for that:

https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard

The documentation recommends changing tmux's default command, but if that weirds you out, a simple alias to "reattach-to-user-namespace pbcopy" also works.

Re: Tools I Use - tmux

#10
I use screen regularly, but mostly to be able to attach and detach to sessions as I move between work, home, etc.

tmux users frequently tout its ability to do nifty split screens and other window management, but I'm not sure I understand the value of doing this over just starting another iterm2 window/tab and using regular window management tools. Cmd-tilde or Cmd-tab is one less key than Ctrl-a, h.... :) What am I missing?

Post reply on HN