Yesterday I was helping a friend setting a box with no graphical session: I fired up tmux in the linux virtual terminal and then proceeded to realize without my tmux.conf I couldn't do a thing because I have always been using entirely different keybindings from the default.
This is the problem with too much customization. Learning to use the default configuration may be difficult but it's probably worth the effort, for vim it has definitely been in my experience.
I am author of <i>The Tao of tmux</i>, a book I just finished a few weeks ago. You can read it publicly at <a href="https://leanpub.com/the-tao-of-tmux/read" rel="nofollow">https://leanpub.com/the-tao-of-tmux/read</a>.<p>One of the things I stress in my book is that there is no "correct" way to use tmux. The approach I take to teaching tmux is separating it into its objects: The server, sessions, windows and panes. Then where they stand in relation to one another, how configurations work, and then leave some examples of usage available to the user so they can pick out work flows they may like.<p>I'm sort of against the approach of just throwing a config / toolkit at someone a la oh-my-zsh and spf13-vim (even though I think they're ok after you've learned to customize yourself). The gift of allowing someone to wrap their brain around something will let the rest come to them.
I basically use tmux as my window manager. I only typically open two programs: a browser, and a terminal. Both are always in full-screen mode.<p>It makes things nice and simple. No matter if I'm working on a laptop or a desktop, all my terminal windows end up in the same place and have the same settings. It's great!
So this may mark me out as different, but apart from persistent remote connections, I've never really felt the need for screen/tmux.<p>I've been trying to figure out what the fuss is about, and I still really don't understand (apart from persistence and screen sharing.)<p>When I want multiple terminals, I just fire up another terminal window and hey presto, jobs a goodun. I have a fairly high res screen and small fonts, so I can fit many terminals on one screen. If I run out, I hop over to a new virtual screen.<p>Perhaps this is a by product of working in linux/unix so long? I can imagine that if I was forced to use putty, where connection setup is costly and screen space scarce, I'd want tmux to make things quicker.<p>What am I missing?
I use tmux constantly but I barely know three tmux commands. Get all the benefit with none of the cognitive overhead with `tmux -CC` in a supported terminal (like iTerm). It allows the GUI program to take charge of the windowing and paneling in its own native way. It's lovely.
It still sounds like a very shallow (naive?) use of tmux to me, I'm in no way a real power user of tmux and I use a lot more feature than that.<p>You could talk about binds without prefix, sessions, customized status bar, pane swapping, bind keys to script launching, plugins, pane highlighting...<p>And the best feature of all for me: maximized pane toggle. I use that ALL the time.<p>I never could find all features I needed from an emulator (plus, I want a drop-down terminal), Tmux have them all and more and I'm not dependent of a specific emulator.
Most people use tmux locally, because their terminal emulator doesn't do what they need it to do, or the window manager doesn't do it. Using tmux locally merely supplements the window manager. I stopped using tmux locally after switching to i3 (and I believe any other tiling / proper wm would do). Now my only use case for tmux is on the server where I'm running weechat. When sysadmining, it's eaiser for me launch few terminals in my window manager and ssh to the same server, then running tmux remotely. It's simply a question of ergonomics, how many sets of keyboard shortcuts do you need to remember to handle a multiplex... eh, window manager running inside a window manager?
echo "alias tmux='screen'" >> ~/.bashrc && source ~/.bashrc<p>But in all seriousness, I do sometimes find myself using tmux, but I try hard not to fragment myself over tools too much, especially with screen finally having vert split, and tmux being BSD, this is one of those cases where I think screen while it has some quirks and may have a bit of a learning curve is worth the effort.<p>edit: Since I didn't provide much value and my comment was a bit snarky, here is a truly useful tmux shortcuts and cheatsheet link:<p><a href="https://gist.github.com/mischapeters/462c6f383bfd9b2f9eea3fb7e6e5b79d" rel="nofollow">https://gist.github.com/mischapeters/462c6f383bfd9b2f9eea3fb...</a>
You are not using tmux properly if you don't have tmux-fingers ( <a href="https://github.com/morantron/tmux-fingers" rel="nofollow">https://github.com/morantron/tmux-fingers</a> ) installed B)<p></shameless-plug>
There is one thing I want from my terminal multiplexer: working scroll functionality with Shift+PgUp/PgDn, even in split screens, just like in a plain console, without messing everything up. Is that possible?
I used to be an extensive user of tmux, basically I'd have a sprawling set of sessions, all backed up with the continuum and resurrection plugins. It allowed me to armory seemlessly work remote on my main dev box or through SSH. Of course the biggest pain was consolidating the X11 clipboard and tmux's internal one.<p>Since I switched to Emacs though I've gradually peeled away the tmux layer. I still run without X11 version of Emacs so I can remote in, but Emacs itself does an equal or better job at pane management and session persistence, especially using daemon mode. ANSI term inside Emacs, something that has really improved in the past few years, has cinched the deal for me. Tmux had become bloat at this point for me.
After experimenting with mosh, tmux, screen, etc I've finally found my ideal ssh setup. At work I do development on my Mac and run builds on a cloud desktop. My Setup:<p>1. Unison for file-sync (<a href="https://www.cis.upenn.edu/~bcpierce/unison/" rel="nofollow">https://www.cis.upenn.edu/~bcpierce/unison/</a>)<p>2. iTerm on Mac<p>3. AutoSSH for more durable SSH sessions (ex. close laptop & reopen at home) - <a href="http://www.harding.motd.ca/autossh/" rel="nofollow">http://www.harding.motd.ca/autossh/</a><p>4. tmux -CC command to attach to tmux session with iTerm Tmux integration. This is the killer feature, it treats a tmux session as a native iTerm window. This means all of the 'learning' you previously had to do with Tmux is nearly non-existent (copy / paste, switching tabs, etc). My biggest annoyance with TMux was the copy / paste special handling. Huge productivity loss.<p>All-together it looks something like this:
Open iTerm.
autossh -t myRemoteHost "tmux -CC -A"<p>Instantly have a _fairly_ durable terminal session on my remote desktop.
I'd argue that using a terminal multiplexer like tmux or screen on a production server (as this article implied) often means you are doing things wrong.<p>It is better to set up a service (systemd or other) and configure it to start correctly rather than relying on a tmux session to manage long running processes. By going this route you get logging, auto restarting, starting on boot, monitoring etc for free.
I love Tmux, I just can't seem to wrap my head on how to COPY and PASTE something lol. Anyone have any step, by step tutorial for how to copy and paste like VIM? I would like to be able to see what is being copied just like in VIM's visual mode. Like If I can copy some code in VIM and then go to paste in another REPL pane in TMUX then that would be my ideal goal!
In my config, some better mouse support, 256color, history saving, config reload, and emoji-weather (temp + icon) in the status bar.<p><a href="https://github.com/philippeback/dotfiles/blob/master/.tmux.conf" rel="nofollow">https://github.com/philippeback/dotfiles/blob/master/.tmux.c...</a><p>Emoji-weather is to be taken from <a href="https://github.com/justincampbell/emoji-weather" rel="nofollow">https://github.com/justincampbell/emoji-weather</a><p>Got this from Justin Campbell on LiveCodingTV. He has pretty good dotfiles <a href="https://github.com/justincampbell/.dotfiles" rel="nofollow">https://github.com/justincampbell/.dotfiles</a><p>His Vim one pretty much takes the cake: <a href="https://github.com/justincampbell/.dotfiles/blob/master/.vimrc" rel="nofollow">https://github.com/justincampbell/.dotfiles/blob/master/.vim...</a><p>and this tmux-pomodoro is sweet. <a href="https://github.com/justincampbell/tmux-pomodoro" rel="nofollow">https://github.com/justincampbell/tmux-pomodoro</a><p>definitely more stuff than in mine <a href="https://github.com/philippeback/dotfiles/blob/master/.vimrc" rel="nofollow">https://github.com/philippeback/dotfiles/blob/master/.vimrc</a>
<i>I use ... Screen on production servers. ... Screen has the lightest footprint</i><p>dtach, which is what I use on production servers even though it usually doesn't come standard, probably has the lightest footprint if you just want to return to some screen later. It doesn't maintain history, however, the screen is redrawn, if possible, on reattach.<p>Otherwise, yes. Both tmux and the book are great (if you don't mind getting drawn into wasting time on customizing the status bar and such).
Tmux dot files with annotations-- may be helpful for people here.<p><a href="https://news.ycombinator.com/item?id=13570010" rel="nofollow">https://news.ycombinator.com/item?id=13570010</a><p>Direct link to the tmux dot files repo on GitHub:<p><a href="https://github.com/SixArm/sixarm_tmux_dotfiles" rel="nofollow">https://github.com/SixArm/sixarm_tmux_dotfiles</a>
I have my tmux/vim set up so that C-(h,j,k,l) navigates vim splits and tmux panes seamlessly. The only downside was that I had to rebind C-l to C-o to clear my shell. But it makes it a lot more productive when using multiple shell panes along with my vim session in one terminal window.
A big thing I've done is use my multiplexer segregate contexts. When I spin up screen (tmux would work the same, just never switched) I set an environment variable noting the particular context I'm working in, and I adjust my PATH, HISTFILE, and more based on this variable.
Great read - prompted me to actually learn tmux, has been worth it! Also thanks for the link to the book, I ended up buying <a href="https://pragprog.com/book/bhtmux2/tmux-2" rel="nofollow">https://pragprog.com/book/bhtmux2/tmux-2</a>
My favorite tip: add bindings with the control key. So if you use "Ctrl-b n" to go to the next pane, add a binding for "Ctrl-b Ctrl-n". It's easier to keep the Ctrl key pressed than to lift it.
Does mouse copy and paste work correctly with tmux? I find that it selects spans across multiple panes. Is there a way to fix this or Windows or Linux?
> uses gnu screen on all servers.<p>> uses tmux on dev box<p>> advocates tmux but do not mention a single feature not on gnu screen.<p>why on earth would someone be that impractical?! just get a single gnu screenrc file that does all that and call it a day on every single environment you work on.
Honestly, tmux is not hard to use. It has some contorted key bindings, sure, but its benefits are so immediately huge that the motivation to learn its quirks is huge too. And, unlike say, vim, it only has 3 things you really need to know: panes, windows, detach. Most people who use tmux, even casually, will inevitably be using it 'properly', within a week, and fluidly within a month. So this blog post is quite redundant.