News for hackers. Stuff that matters.
Re:My tmux setup by akurilin on Friday November 15, 2013 @02:03PM (#6741407)
I can't recommend Pragmatic Bookshelf's book on tmux enough: http://pragprog.com/book/bhtmux/tmux

It's got the whole thing covered end-to-end if you ever wanted to get around learning it.

Re:My tmux setup by bphogan on Friday November 15, 2013 @02:31PM (#6741566)
Author of that book here. Thank you for the kind words.
Re:My tmux setup by mitchty on Friday November 15, 2013 @02:45PM (#6741665)
Reader of that book, you finally got me to kick my screen habit with it and now I have a new tmux addiction.

That said, tmux is way easier to use compared to screen. And with 1.8 and text reflow it pretty much has every feature from screen I ever wanted/needed/used.

Re:My tmux setup by ilteris on Friday November 15, 2013 @03:13PM (#6741860)
I also love the new zoom pane that comes with 1.8 prefix <c-Z>. It comes very handy!
Re:My tmux setup by necro on Friday November 15, 2013 @04:17PM (#6742200)
Is there an option/way to have "lables" in panes. Just like you have a info bar for windows, I would love to label my panes. Normally have a bunch of panes setup for logs, and it would be really nice to label them so i could tell what is in each pane.
Re:My tmux setup by ilteris on Friday November 15, 2013 @11:00PM (#6743553)
not that I know of. panes have numbers windows have names afaik but I might be wrong.
Re:My tmux setup by AjithAntony on Friday November 15, 2013 @05:35PM (#6742619)
Didn't know about this. Love it. Appears to be prefix z for me. C-z seems to background the tmux session, which seems reasonable.
Re:My tmux setup by ilteris on Friday November 15, 2013 @10:59PM (#6743547)
yes sorry, you are correct. prefix z it is.
Re:My tmux setup by akurilin on Friday November 15, 2013 @06:55PM (#6742881)
Didn't know about that one, should have read the changelog more carefully! Thank you!
Re:My tmux setup by awnird on Friday November 15, 2013 @03:14PM (#6741863)
Another reader here. That book was enormously helpful for me, thanks!
Re:My tmux setup by ilteris on Friday November 15, 2013 @03:10PM (#6741839)
Another reader here. Your book demystified tmux for me. Thank you.
Re:My tmux setup by jasonlotito on Friday November 15, 2013 @03:34PM (#6741974)
I'll take every opportunity to just praise you good sir, and gush over your wonderful book. Because it is indeed a wonderful book. It sits happily on my shelf.
Re:My tmux setup by ScienceData on Saturday November 16, 2013 @05:07AM (#6744325)
Can you make it cheaper to buy both ebook and the print book? Ideally, I would have hoped that the ebook would come free with purchase of a print book…I would really like to buy both
Re:My tmux setup by denrober on Saturday November 16, 2013 @02:27AM (#6744058)
I just bought a copy. Can't wait to kick screen to the curb.
Re:My tmux setup by gbin on Friday November 15, 2013 @01:34PM (#6741205)
For the vim lovers, this trick is quite good :

  unbind [ # free the weird binding
  set-window-option -g mode-keys vi # switch to vi bindings
  bind Escape copy-mode # ctrl-a ESC put your pane in a kind of vi normal mode
  bind-key -t vi-copy v begin-selection # start a visual select mode with v like in vim
  bind-key -t vi-copy y copy-selection # yank with y
  unbind p # free another weird binding 
  bind p paste-buffer # paste with crtl-a p
Re:My tmux setup by pyre on Friday November 15, 2013 @10:41PM (#6743485)
How is p a weird binding? It's a pneumonic for "previous" and works the same as it does in gnu screen, which is tux's "competitor."
Re:My tmux setup by gbin on Saturday November 16, 2013 @12:31AM (#6743764)
indeed, agreed. I only use the prefix number shortcut for that.
Re:My tmux setup by derleth on Saturday November 16, 2013 @12:42AM (#6743803)
> It's a pneumonic for "previous"

I'm guessing this is autocorrect, but an autocorrect that knows 'pneumonic' (the Firefox spell-checker doesn't!) but not 'mnemonic' seems even less likely than a person who knows the first word but not the second.

Anyway, 'previous' is perhaps less likely to spring to mind than 'back' or 'reverse' or even 'last', each of which would have different mnemonics. ('Last' has a particularly good mnemonic if you keep your hands to the Holy Home Row, which is why vi users, who are most likely to worship at the Altar of the Home Row, can't use it.)

Re:My tmux setup by LesZedCB on Saturday November 16, 2013 @10:35AM (#6745071)
previous is unambiguous. Last is extremely ambiguous. Last = Nth element or current -1? Similar with back or reverse. Previous means N-1 every time. Also it's a pretty commonly used programmer idiom.
Re:My tmux setup by d0m on Friday November 15, 2013 @03:42PM (#6742024)
I've used tmux so much in the past... so much that the only thing that my OS would do is run tmux ;-) So I've decided to use a different window manager: StumpWM. So, in a nutshell, all my window manager is now a big tmux - and I run browsers fullscreen in some screens. That's the best coding setup I've ever had.
Re:My tmux setup by ceocoder on Friday November 15, 2013 @03:51PM (#6742075)
Love tmux

Here is mine - http://dhaiv.at/dotfiles/ I use ` (backtick) as my escape key, that makes jumping between windows just a double tap on `

`+" to list all windows, really handy.

`+| to split vertically

tmux.conf for interested https://github.com/ceocoder/tmuxrc/blob/master/tmux.conf

Re:My tmux setup by rogerbinns on Friday November 15, 2013 @03:05PM (#6741799)
I highly recommend byobu - http://byobu.co - which front ends screen or tmux. It uses the function keys for switching around, gives a good status bar by default etc.
Re:My tmux setup by r080 on Friday November 15, 2013 @03:21PM (#6741894)
The last tip on naming windows after remote hosts is nice! Now it'd be nice if we could run similar to ssh's LocalCommand on exit too. Turned out that I'm not the first to ask this: http://unix.stackexchange.com/questions/40899/ssh-localcomma... With workaround too.

The downside is that if go like ssh A then ssh B, display doesn't update. But I don't this too often anyway.

Re:My tmux setup by Erwin on Friday November 15, 2013 @03:56PM (#6742101)
I spent a bit of time trying to figure out why it didn't work for me. Then why I couldn't even do the usual echo -e ... to change my gnome-terminal's title. Turns out I already had a PROMPT_COMMAND set to echo the last command into the title which was overwriting my changes.
Re:My tmux setup by jff on Friday November 15, 2013 @03:44PM (#6742046)
We use a combination of tmux and mumble to get multiple remote-working coders all looking at one screen. It's very useful, even if we sometimes type over each other. It's also great when somebody has to give a demo but only the guy 3 states away can really get things configured properly--just fire up a shared tmux session!
Re:My tmux setup by farresito on Friday November 15, 2013 @01:45PM (#6741287)
tmux is like that thing that you hear about quite often, that you think it's not that useful, but that, once you try, you realize why and where its fame comes from.

I adopted tmux about a month ago and I can't really complain much. It's just awesome. If you work a lot in the terminal (I do), I would highly recommend using it.

Re:My tmux setup by gbog on Saturday November 16, 2013 @01:41AM (#6743959)
I did not switch yet. I use screen often, and each time I checked the diff with tmux it seemed to be the same thing with slightly different defaults.
Re:My tmux setup by e12e on Saturday November 16, 2013 @09:53AM (#6744921)
I use screen quite a lot -- and with xmonad as my main wm, I really don't need many features from screen -- I just have one screen per terminal window.

A friend of mine uses OS X -- and there tmux comes more to it's right as there's no (Free) way to get sane (for biased values of sane) window management under OS X.

[edit: It might be worth noting, that after running into a lot of problems with unicode input and urxvt, I switched to sakura[1] for my terminal -- and it's basically a lighter gnome terminal that's easy to set up without any chrome. Under debian I bind that to my x-terminal-emulator alternative, and I can ctrl-enter to open a new terminal via xmonad (xmonad needs a short config to use x-terminal-emulator though).

[1] http://www.pleyades.net/david/projects/sakura ]

Re:My tmux setup by farresito on Wednesday November 20, 2013 @09:07AM (#6768000)
Well, if you use screen and it works for you, then it might be a good idea to keep using it. Why change something if it works? :D. Both tmux and screen are similar. By the way, that's the config I personally use and it works pretty well: https://github.com/tony/tmux-config.git.
Re:My tmux setup by Touche on Friday November 15, 2013 @04:02PM (#6742118)
How does that email script work? Here it is:

https://github.com/mrtazz/bin/blob/master/imap_check.py

This looks for a file at ~/.netrc

What is the format of that file? Google results can't find this being used for email anywhere.

Re:My tmux setup by mrtazz on Friday November 15, 2013 @04:14PM (#6742186)
I'm using the netrc account field as an identifier on which I filter account info in the lambda function. More info about fields are here http://linux.die.net/man/5/netrc
Re:My tmux setup by fragmede on Friday November 15, 2013 @04:04PM (#6742128)
Mine looks like:

  machine smtp_server.company.com
          login [email protected]
          password supersecret
Re:My tmux setup by gcv on Saturday November 16, 2013 @03:50AM (#6744200)
I've been using screen for years. It works well for me. Can someone list some reasons to switch to tmux? Just about the only thing which annoys me in screen is the awkward switch to "copy mode" to scroll, instead of just hitting PgUp.
Re:My tmux setup by thevdude on Saturday November 16, 2013 @12:14PM (#6745473)
no patching for vertical and horizontal splits (I know screen doesn't do one of them without a fair bit of work).

tmux isn't a dead project.

Spirit of exploration? I started with tmux and no screen experience, but I've converted a few people to tmux by them just giving it a chance, basically.

Re:My tmux setup by arunc on Saturday November 16, 2013 @10:16AM (#6745004)
I found it helpful with z being the bind key. c-z c-z to switch windows. To send SIGSTOP, then ESC c-z. Checkout https://github.com/carun/dot-files/blob/master/.tmux.conf
Re:My tmux setup by era86 on Saturday November 16, 2013 @12:36AM (#6743785)
Thanks for sharing! I was introduced to Tmux at work earlier this year. We used it primarily for remote pairing, but now I use it for anything and everything terminal.
Re:My tmux setup by KaiserPro on Friday November 15, 2013 @02:30PM (#6741564)
One of things I've been meaning to ask: do people who use tmux mostly run a windows machine as their desktop?
Re:My tmux setup by jlgreco on Friday November 15, 2013 @03:53PM (#6742088)
At work I use Windows->Putty->Linux->tmux, at home I use Linux->urxvt->ssh->Linux->tmux and Linux->uxrvt->tmux. When working on a Linux machine directly, I also use a tiling window manager.
Re:My tmux setup by tokenrove on Friday November 15, 2013 @06:33PM (#6742809)
Do you mean as opposed to people who use screen, or as opposed to people who somehow do without either? Since tmux was invented in the OpenBSD world, I expect it's still mostly Unix users.
Re:My tmux setup by teh_klev on Friday November 15, 2013 @05:45PM (#6742662)
For me yes, Win7 + MobaXterm which totally rocks, so much so I paid for it. Worth the punt just for the X support i.e. PyCharm running on remote server with UI on my Win7 desktop.
Re:My tmux setup by revscat on Friday November 15, 2013 @02:49PM (#6741703)
No. It is very difficult to get tmux running on Windows. Not impossible, mind, but not as simple as e.g. 'brew install tmux'.
Re:My tmux setup by AjithAntony on Friday November 15, 2013 @05:45PM (#6742663)
recent post on using tmux on cygwin inside a mintty https://news.ycombinator.com/item?id=6737795
Re:My tmux setup by jaredmcateer on Friday November 15, 2013 @03:14PM (#6741867)
Nope I use it almost exclusively in Linux.
Re:My tmux setup by IanCal on Friday November 15, 2013 @03:06PM (#6741805)
I use a mac, and tmux essentially gives me a tiling window manager for most of my dev tasks (vim + terminals).
Re:My tmux setup by laumars on Friday November 15, 2013 @06:36PM (#6742821)
Nope. Linux, FreeBSD and Solaris. But mainly Linux
Re:My tmux setup by vch on Friday November 15, 2013 @06:58PM (#6742894)
glad to see love for tmux. I've been a user for 3+ years. Thank you nicm.
Re:My tmux setup by dmamills on Friday November 15, 2013 @02:03PM (#6741399)
Just this last week I was introduced to tmux, it's seriously awesome.
Re:My tmux setup by bct on Friday November 15, 2013 @02:47PM (#6741678)
jnycs: you have been hellbanned for no particular reason.
Re:My tmux setup by sp332 on Friday November 15, 2013 @04:34PM (#6742292)
Probably getting his very first comment downvoted a bunch triggered some heuristic. jnycs: email [email protected] to appeal.
Re:My tmux setup by deanstag on Saturday November 16, 2013 @10:21AM (#6745019)
I have my prefix key as alt-j. Very convenient.
Re:My tmux setup by pjbrunet on Friday November 15, 2013 @01:49PM (#6741331)
I think this blog post needs some screenshots!
Re:My tmux setup by asdasf on Friday November 15, 2013 @01:12PM (#6741018)
>But the years of using screen have ingrained in my muscle memory to use ctrl-a

I still don't understand how this happened to so many people. Ctrl+a is already taken, how did anyone ever use screen without immediately changing it to something that doesn't conflict with a frequently used shell shortcut?

Re:My tmux setup by jlgreco on Friday November 15, 2013 @01:46PM (#6741300)
The only thing ctrl-A is used for by me besides screen (or rather, tmux after I remapped it), is incrementing a number in vim. Not really a big deal.
Re:My tmux setup by montecarl on Friday November 15, 2013 @03:19PM (#6741884)
Most people I know use it to go to the beginning of a line in programs that use readline, which includes the shell as well as most programming language interpreters.
Re:My tmux setup by jlgreco on Friday November 15, 2013 @03:44PM (#6742045)
You can set readline's editing mode to vi so that anything that uses readline will then have vi-style bindings. Very useful, particularly when combined with rlwrap for those few programs that don't have readline support.

Zsh doesn't use readline (it has it's own line editor) but it can be set to vi-style input too. (Actually, at least on my system, bash doesn't seem to be linked with libreadline.. I'm not sure if it is actually using readline or not)

Re:My tmux setup by pyre on Friday November 15, 2013 @04:40PM (#6742322)
Bash uses .inputrc which configures readline, so if it's not actually using libreadline, it's emulating it pretty well.
Re:My tmux setup by jlgreco on Friday November 15, 2013 @04:56PM (#6742421)
It looks like bash does use readline, though it's not dynamically linked with it (at least on my system). Kind of seems like bash and readline are intertwined more than I thought; the git repo for bash has a distribution of readline included in it.
Re:My tmux setup by gcr on Saturday November 16, 2013 @01:01PM (#6745719)
That makes sense to me. The shell is fundamental to the system, and is so heavily intertwined with readline that it is very sensitive to ABI/API changes. Consider: if you upgrade your readline without upgrading bash, or vice versa, you lose the ability to fix the problem even in single user mode. Having Bash control its own readline usage seems like the safest option, though conceptually a bit more complex.
Re:My tmux setup by saraid216 on Saturday November 16, 2013 @03:41AM (#6744183)
I started using screen before I started learning that facility. (At the time, I mostly used Windows, so the Home key was available.)

Of course, when I started developing on a Macbook, screen rapidly became problematic as there was no Home key and I started using Ctrl-A. For the moment, I'm developing locally so I don't need screen or tmux, but I'm working on off-loading to a VM and I'll be using tmux there for the purposes of maintaining my own sanity.

Re:My tmux setup by Nick_C on Saturday November 16, 2013 @10:24PM (#6747419)
I map Ctrl-q to beginning of line in .inputrc.

    Control-q: beginning-of-line
I know, I know, now we are remapping all over the place. But my muscle memory for Ctrl-a was too ingrained after years of screen usage.
Re:My tmux setup by fsckin on Friday November 15, 2013 @02:42PM (#6741646)
With a vimscript [0], ctrl-a can increment dates, times, roman numerals, ordinals, etc. Pretty damn handy along with ctrl-x to decrement.

[0] https://github.com/tpope/vim-speeddating

Re:My tmux setup by jlgreco on Friday November 15, 2013 @02:50PM (#6741715)
I actually do use that, but ctrl-a/ctrl-x is still something I rarely find myself using more than a few times a week. Still a great plugin though.
Re:My tmux setup by jzawodn on Friday November 15, 2013 @01:27PM (#6741142)
Indeed. I've been using Ctrl-\ as my Ctrl-a in screen (and occasionally tmux). Turns out that I never use that keystroke in real life.
Re:My tmux setup by bphogan on Friday November 15, 2013 @02:34PM (#6741593)
I'd always used Ctrl-a in screen because it was the default. When I moved to tmux I just moved it there, but tmux lets me send the Ctrl-a key sequence through to those apps.

So if I want to go to the beginning of a line in Bash, I just press C-a C-a (which actually works if I hold down Ctrl and press 'a' twice.

Not a big deal at all, and since I remap Caps Lock to Ctrl, the command combo is right on my left hand. (I slide my hand over a bit as if I were playing guitar or piano, rather than stretch fingers, so pinky on CapsLock, ring finger on a.)

Re:My tmux setup by 1amzave on Friday November 15, 2013 @07:57PM (#6743085)
I've been doing the same for a while, despite the fact that C-\ is in fact sort of already "taken" by default (SIGQUIT). That's not something I use often, but when I want it it's still easy enough to get by just sending C-\ twice. The only downside is occasionally (whether by accidental double-triggering or hitting C-\ out of habit when not actually running screen) killing foreground processes by mistake.
Re:My tmux setup by gbog on Saturday November 16, 2013 @01:32AM (#6743935)
You should, ctrl-\ is the best process killer. No way to escape from xtail without it, for instance. And sometime it will help getting out of python scripts like nosetests.
Re:My tmux setup by oahziur on Friday November 15, 2013 @07:11PM (#6742932)
I use Ctrl-o as my key bind for tmux. Maybe Ctrl-\ is a better choice for me, since Ctrl-o conflict with something that I does not always using.
Re:My tmux setup by Goladus on Friday November 15, 2013 @03:44PM (#6742043)
ctrl-\ here, too.

The guy introduced me to screen recommended it. His words were "if you're an emacs guy, having this mapped to ctrl-a is going to drive you crazy"

Re:My tmux setup by oahziur on Friday November 15, 2013 @07:14PM (#6742940)
Agreed, I will be crazy if I use ctrl-a. Also it conflict with start of line of default bash settings
Re:My tmux setup by c0un7d0wn on Friday November 15, 2013 @01:54PM (#6741349)
I've been using `
Re:My tmux setup by w1ntermute on Friday November 15, 2013 @02:28PM (#6741548)
Same here. It's really hard to press if you don't swap Ctrl and Caps Lock though.
Re:My tmux setup by c0un7d0wn on Friday November 15, 2013 @02:57PM (#6741752)
No key chords, just left pinkie, why would it be so hard?
Re:My tmux setup by w1ntermute on Saturday November 16, 2013 @11:19AM (#6745235)
My bad, I thought you meant Ctrl + `
Re:My tmux setup by brianpgordon on Friday November 15, 2013 @02:41PM (#6741639)
For me ` is taken by tilda:

https://github.com/lanoxx/tilda

Re:My tmux setup by Nick_C on Saturday November 16, 2013 @10:22PM (#6747413)
I use the Windows Menu key (the Windows key to the right of the spacebar) for that. Except I use yeahconsole, which is the same concept without the Gnome dependencies.

Such a handy feature, isn't it. I would be lost without my drop-down console.

Re:My tmux setup by metabrew on Sunday November 17, 2013 @07:46AM (#6748672)
Isn't that siginfo?

You can send it to ping on linux to print a report line without terminating, for example.

Re:My tmux setup by graywh on Friday November 15, 2013 @01:47PM (#6741309)
I use ctrl-_. In many terminals you can generate it with ctrl + 7 and/or ctrl + ?.
Re:My tmux setup by daniel_solano on Friday November 15, 2013 @01:19PM (#6741068)
Well, some of use vi bindings, and Ctrl+a isn't as commonly used there.
Re:My tmux setup by rsync on Friday November 15, 2013 @03:01PM (#6741776)
Because ctrl-a is extremely simple, physically ... for one hand, etc.

ctrl-b is fairly quick and easy if you use two hands (which is inferior to using one hand) and is quite a bit more difficult than ctrl-a when using one hand.

Re:My tmux setup by thevdude on Saturday November 16, 2013 @12:11PM (#6745461)
I ctrl+b with my left hand only. Pinky on left ctrl, index finger on b. I've never had any issues with it.
Re:My tmux setup by asdasf on Friday November 15, 2013 @03:45PM (#6742048)
You appear to have invented some other post to respond to, mine said nothing about ctrl+b.
Re:My tmux setup by publicfig on Friday November 15, 2013 @04:40PM (#6742324)
Ctrl+b is the standard key combo for tmux, which is why that was mentioned in the article in the first place.
Re:My tmux setup by Sssnake on Friday November 15, 2013 @09:20PM (#6743290)
That has nothing to do with the subject of the post in question though. He asked how people ever got accustomed to ctrl+a in the first place, since ctrl+a is already taken by your shell and every readline app, so 90% of people immediately remapped screen to use something else instead of ctrl+a. Tmux and ctrl+b don't enter into the discussion at all.
Re:My tmux setup by jasonlotito on Friday November 15, 2013 @03:33PM (#6741961)
You map CTRL+A x2 to send CTRL+A to the shell, and it works.
Re:My tmux setup by osivertsson on Friday November 15, 2013 @03:51PM (#6742076)
Yes I do sort of this, only I use CTRL+Z instead, works sweet:

  # C-z as prefix key. C-z C-z will send C-z to application, C-z z cycles last window
  set-option -g prefix C-z
  unbind C-b
  bind-key C-z send-prefix
  bind-key z last-window
Re:My tmux setup by dllthomas on Friday November 15, 2013 @06:39PM (#6742837)
By default it's C-a a, which I like.
Re:My tmux setup by stormbrew on Friday November 15, 2013 @08:13PM (#6743137)
I use screen/tmux control combos far more frequently than I've used ctrl-a for beginning of line. That's what the home key is for (cue thousands of vim users telling me I shouldn't use any key that wasn't on a keyboard 40 years ago).
Re:My tmux setup by donatj on Friday November 15, 2013 @02:05PM (#6741412)
Control-A / Control-E is by far the most uniform start of line/end of line keyboard shortcut in OS X, and moreover I can use it without taking my hands off home row.
Re:My tmux setup by nviennot on Friday November 15, 2013 @05:24PM (#6742572)
I use Alt. No double strokes: https://github.com/nviennot/tmux-config
Re:My tmux setup by docwhat on Sunday November 17, 2013 @02:04PM (#6750269)
I use backtick. It's great not having to reach for a control or alt key to change window.

It is a minor annoyance in markdown but in shell programming I use `$(...)` instead, since it can be hard to tell if a character is a backtick or a single quote.

Re:My tmux setup by saidajigumi on Friday November 15, 2013 @01:53PM (#6741347)
Agreed completely. I used Ctrl-] with screen and just kept that convention with tmux. Ctrl-a is a non-starter for Emacs users, and even neglecting that, there are many contexts where Ctrl-a/Ctrl-e navigation is enabled and useful.
Re:My tmux setup by splawn on Friday November 15, 2013 @04:14PM (#6742182)
Serious question, what does tmux have to offer emacs users? I used and loved tmux back when vim was my editor, but after switching to emacs (thanks evil-mode), I stopped using it because emacs seems to cover all the bases on its own.
Re:My tmux setup by creese on Saturday November 16, 2013 @11:38AM (#6745336)
Try running emacsclient inside tmux. It's a good combination.
Re:My tmux setup by wladh on Friday November 15, 2013 @08:50PM (#6743222)
For the same reason (I'm using Ctrl+a in the shell), I'm using Ctrl+q as prefix for tmux. I'm quite surprised that I've never heard of anybody else using this combination.
Re:My tmux setup by pyre on Friday November 15, 2013 @10:37PM (#6743472)
You might have issues if you ever accidentally hit ctrl-s and need to use ctrl-q.
Re:My tmux setup by andyl on Friday November 15, 2013 @01:19PM (#6741072)
Tmux is such a fantastic tool - its made a big difference to my work - thank you and congrats to the authors.
Re:My tmux setup by myared on Friday November 15, 2013 @03:07PM (#6741813)
Couldn't agree more. Switching and committing to tmux (and wemux for pairing) has helped immensely.