News for hackers. Stuff that matters.
Re:An introduction to Tmux by n0us on Saturday April 02, 2016 @11:54AM (#11411940)
Worth noting that you can enable mouse mode which is significantly easier for scrolling. It's also recommended by most people that you remap Caps-Lock to Ctrl and change the activation key from b to a. There are some great themes that make it nicer to look at as well.

I use tmux all the time for things like sshing into a vagrant box. As soon as I'm in I can switch between the tail of my logs, the readout of my build tool, the dev server readout etc. No more fumbling around starting multiple ssh sessions in multiple iTerm tabs. tmux honestly has been a game changer in terms of productivity just because of how easy it is to open things up and look at them. For those who are wondering why you wouldn't just use tabs in iTerm, its really more of an "also" not an "or"

Re:An introduction to Tmux by smw on Saturday April 02, 2016 @12:07PM (#11412016)
Control-a is 'beginning of line'. Why would you possibly pick that?
Re:An introduction to Tmux by sp332 on Saturday April 02, 2016 @12:31PM (#11412117)
It's what screen uses by default, and a lot of people come to tmux from screen so they already have the muscle-memory. Not sure of the original logic though.
Re:An introduction to Tmux by Veratyr on Saturday April 02, 2016 @12:14PM (#11412046)
A lot of people aren't used to the Emacs bindings. Home and End are still widely used.

Really annoys me when I have to work on a server that has the Ctrl-A bindings in tmux though.

Re:An introduction to Tmux by bphogan on Saturday April 02, 2016 @02:02PM (#11412508)
You set prefix to C-a and then send double-presses on.

So C-a-a still does beginning of line.

Re:An introduction to Tmux by n0us on Saturday April 02, 2016 @12:21PM (#11412080)
Control-s/e/d/f/whatever you want then. The point is to avoid having to reach all the way over to 'b'.
Re:An introduction to Tmux by CardenB on Saturday April 02, 2016 @02:39PM (#11412686)
Probably because that's how screen did it before tmux
Re:An introduction to Tmux by nilkn on Saturday April 02, 2016 @12:55PM (#11412201)
> For those who are wondering why you wouldn't just use tabs in iTerm, its really more of an "also" not an "or"

In my case, I tend to ssh to one remote host, where I have a tmux session running with its own tabs, each of which is ssh'd to a bunch of other machines (10+).

By doing it this way, I can access all my remote ssh sessions from anywhere by just accessing that one initial machine and connecting to the tmux session.

I currently use tmuxinator to recreate the whole elaborate construction if I ever need to.

Re:An introduction to Tmux by jakupovic on Saturday April 02, 2016 @02:42PM (#11412701)
I do the above as well with 1 addition, any of the virtual tabs on my remote host can also run a screen themselves. To control this I use Ctrl-Oo to control the outer screen and ctrl-a for inner screens. This is useful when you have a remote dev server for a particular app and want need multiple connections to it, such as running nodejs server and tailling the output in one shell while using the editor in the other. I only started using this recently but it has worked very well.
Re:An introduction to Tmux by xufi on Saturday April 02, 2016 @01:58PM (#11412477)
intersting use. I always wondered if that was managable because I'd be afraid to lose track of all those machines
Re:An introduction to Tmux by branchless on Saturday April 02, 2016 @11:57AM (#11411960)
I use emacs and most keys are bound. I'm really wondering what emacs devotees use with tmux.
Re:An introduction to Tmux by robenkleene on Saturday April 02, 2016 @12:44PM (#11412161)
I use Emacs on and off, as well as Vim, and the key I've settled on for tmux prefix is ^q. It doesn't conflict with anything useful (that I've found anyway) and it's easy to hit with a caps lock as control.

For the record ^b is also move backwards by character in basic readline bindings (so it works in Emacs, on the command line, and everywhere on OS X). I've always found it baffling the programs like tmux and screen override readline bindings. Shouldn't those be on the list of bindings to never override?

Re:An introduction to Tmux by Saser on Saturday April 02, 2016 @01:42PM (#11412405)
In zsh (or at least with my configuration, which is prezto with a few plugins), Ctrl-q lets you "stash" your current command.

Say that you are typing some really long, complex command, and suddenly you realize that you are in the wrong folder. You press Ctrl-q (which clears the command and "stashes" it), then you cd to the right folder. As soon as you return to the prompt after issuing your cd command, your really long, complex command is back just as you typed it.

Re:An introduction to Tmux by Scarbutt on Saturday April 02, 2016 @01:24PM (#11412321)
C-z for the tmux prefix key.
Re:An introduction to Tmux by jebus989 on Saturday April 02, 2016 @02:44PM (#11412706)
Suspend?
Re:An introduction to Tmux by Scarbutt on Saturday April 02, 2016 @06:18PM (#11413785)
yes, at least for me, suspend is useless in both emacs and tmux, why waste a good keychord? :)
Re:An introduction to Tmux by sbagley on Saturday April 02, 2016 @12:12PM (#11412039)
Try this:

  unbind C-b
  set -g prefix `
  bind ` send-prefix
Re:An introduction to Tmux by scentoni on Saturday April 02, 2016 @01:45PM (#11412424)
I use ^t because I never use the transpose-chars function.
Re:An introduction to Tmux by superbaconman on Saturday April 02, 2016 @03:09PM (#11412841)
Remap ctrl-b to ctrl-alt-b

unbind C-b

set -g prefix M-C-b

bind M-C-b send-prefix