Live data from Hacker News

Tmux Tutorial

leimao.github.io

81–90 of 166 posts

Re: Tmux Tutorial

#81
post #2

I have been using screen for almost 10 years now, is it worth switching? I know it's not much learning but why switching when screen is not broken? It feels like there's more important stuff I can learn.

tmux adds more structure to windows, panes, layouts,.... which is not necessarily a good thing in the sense that you can't easily build an arbitrary layout from another arbitrary one. It all depends on your workflow, but tmux can't emulate the completely freestyle layouts of screen.

On the plus side, tmux has plugins that allow pretty sophisticated interactions (more than tmux)

Re: Tmux Tutorial

#83
post #74

Earlier quoted context omitted.

Absolute nonsense, are you trying to press C-b with one hand?

Yes. Left ctrl is in a better placement on many keyboards. Also being able to perform shortcuts with one hand is very handy.

If it hurts your wrist pressing it with one hand, perhaps you should use two...

Re: Tmux Tutorial

#84
post #2

I have been using screen for almost 10 years now, is it worth switching? I know it's not much learning but why switching when screen is not broken? It feels like there's more important stuff I can learn.

not sure how screen is today but I switched to tmux because vsplits were builtin (back in the days you needed patches for screen)

Re: Tmux Tutorial

#85

If you're on a Mac, try tmux -CC with iTerm2. You get tmux goodness like multiple panes, persistent sessions, etc. But you also get native scrolling, native copy and paste, etc. It's what makes tmux usable for me.

Absolutely! TMux is pretty great by itself, but it doing its own internal scrolling and copy-pasting, though essential, is a usability frustration. Tmux + iTerm2 is a fantastic combo that takes all of Tmux's pwer and removes all the downsides. I searched if anything else used Tmux's Control Channel on Linux to replicate iTerm2's features, and I'm sad that I found nothing. (Frankly, it's kind of stunning to me that on…

> Frankly, it's kind of stunning to me that one terminal app on macOS has more useful features than the plethora of me-too terminals on Linux

If by "useful features" you mean intercepting tmux output and having it integrate with the terminal, then no. But more generally, I think the closest thing to iTerm2 on Linux is Tilix [1].

[1] https://gnunn1.github.io/tilix-web/

Re: Tmux Tutorial

#86
post #53
post #50

Looks like some of the shortcuts are really RSI prone, i.e. ctrl + b + & (where & is shift + 7). Are there any possibilities to have more wrist-friendly shortcuts?

A very common change is to change the prefix to ctrl + a, like this in your tmux.conf: # remap prefix from 'C-b' to 'C-a unbind C-b set-option -g prefix C-a bind-key C-a send-prefix I've heard that he reason for ctrl + b is because screen uses ctrl + a, which just doesn't make any sense to me. You can nest both tmux and screen and to get to an inner layer you press (if ctrl + a has been mapped) ctrl + a + a - and now…

I think another reason is because some people use Ctrl+a in bash for jumping to the start of the line.

Re: Tmux Tutorial

#87
post #73
post #62

One of the biggest improvements in my tmux productivity came when I changed my prefix (default Ctrl + b) to backtick (i.e. to `) I am a heavy user of tmux and spend a lot of time switching panes, switching windows, entering visual mode, detatching etc. so this really feels faster. # change prefix to backtick unbind-key C-b set-option -g prefix ` bind-key ` send-prefix

Backtick is a bit far away, isn't it? I literally have to stretch my left ring finger to hit it, so doing this for each tmux key command does add up I suppose? I've been using C-z for the prefix for ages. It's conveniently nearly under the default position where my fingers lay and it also masks the mostly useless suspend signal which I seemed to accidentally hit every now and then. (If I really want to suspend my pro…

Ah you're right, I forgot that the keyboard I use isn't common/standard. Backtick is right above Q for me.

Re: Tmux Tutorial

#88
post #58
post #25

Earlier quoted context omitted.

You could remapped whatever you don’t link. I have Caps Lock set to be Ctrl and tmux set to use Ctrl+a. For a vertical split, I have it mapped to Ctrl+a, |. For horizontal, Ctrl+a, - It’s pretty flexible.

Not sure why ctrl-a and ctrl-b are such popular prefixes, I use both a lot editing readline.

I definitely hear you on ctrl-a. No idea what ctrl-b does, though?

Re: Tmux Tutorial

#89

For those who customize their configs and, like me, SSH into all kinds of different short- and long-lived servers regularly: How do you stay sane? I don't want to have to scp over my tmux conf to every single server I jump on, but OTOH difference in pretty much anything but the prefix gets really frustrating with habits. Particularly remembering all the emacs mode-keys when I really want the vi ones.

I customize/copy my configs on the boxes I use regularly and just learn enough of the defaults to get by on boxes I am using only occasionally (eg I know enough vi to get by but if I am using a box for a bit I install emacs and if I am using it a lot I copy my .emacs as well). It helps that I keep my configs small and in a single file for each program so I can copy them quickly if I need to. For tmux, it will look at…

Didn't consider that the mode can be set from environment variable, then it can just be automatically set from my ssh command, thanks for the tip!

Searching back in the buffer in emacs mode is the one thing I've been keep having to look up

Re: Tmux Tutorial

#90
post #2

I have been using screen for almost 10 years now, is it worth switching? I know it's not much learning but why switching when screen is not broken? It feels like there's more important stuff I can learn.

Tried tmux, then went back to screen. Tmux is for hipsters.

There is also the difference in licenses, and as in users voting with their feet, I chose the BSD licensed alternative to terminal muxing.
Post reply on HN