News for hackers. Stuff that matters.
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.