Live data from Hacker News

Tmux Tutorial

leimao.github.io

21–30 of 166 posts

Re: Tmux Tutorial

#21

OT: How can I use my Mac's mouse to switch the active window in tmux? I have tried Googling this and the .conf setting everyone says to use doesn't work.

Depends on your version so check your docs and man pages, but this ought to work:

    set-option -g mouse on

Re: Tmux Tutorial

#22
post #14

Earlier quoted context omitted.

I often run screen sessions inside tmux if I need to ssh to remote machines. tmux is beautiful and I say that as a screen veteran.

> I often run screen sessions inside tmux if I need to ssh to remote machines What possible reason can there be?

Maybe for avoiding shortcut clashing.

Re: Tmux Tutorial

#23
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.

I switched from screen to tmux some years ago. Long enough that I can't remember exactly why. I held off for a while, but remember finding a handful of small cases where tmux was a bit smoother. Nuanced type things.

If you're using screen, you're already sipping the terminal multiplexer coolaid. I think it's the paradigm that's more important than the specific program/implementation.

Re: Tmux Tutorial

#24
post #20
post #12

One tip I didn't see mentioned (though it's pretty common in tmux) is to use the default window layouts for organizing multiple panes. You do this with Ctrl + b followed by esc + . esc + 1: All windows take up equal space horizontally, and stretch the full vertical width esc + 2: All windows take up equal space vertically, and stretch the full vertical width esc + 3: The first window takes up half of the screen verti…

Just to nitpick a tiny bit, but you mean "panes" and not "windows". Tmux's terms can be slightly confusing and the difference is important in usage!

Good point, thanks for that. Fixing now!

Re: Tmux Tutorial

#25
post #3

Earlier quoted context omitted.

I tried it for awhile, was puzzled by their choices of defaults, and ended up switching back to screen.

I prefer tmux to screen but the default key mappings took some getting used to. I've used it long enough that Ctrl-B and " / % for the screen splitting are natural to me now, but initially it was ... rough.

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.

Re: Tmux Tutorial

#26
post #14

Earlier quoted context omitted.

I often run screen sessions inside tmux if I need to ssh to remote machines. tmux is beautiful and I say that as a screen veteran.

> I often run screen sessions inside tmux if I need to ssh to remote machines What possible reason can there be?

I've had nested tmux sessions before. Usually I'll have a couple tabs on my local device, and then may want to ssh to a remote server and interact with a persistent tmux session there.

I usually make a point of setting different prefix keys in that case though.

Re: Tmux Tutorial

#27
post #12

One tip I didn't see mentioned (though it's pretty common in tmux) is to use the default window layouts for organizing multiple panes. You do this with Ctrl + b followed by esc + . esc + 1: All windows take up equal space horizontally, and stretch the full vertical width esc + 2: All windows take up equal space vertically, and stretch the full vertical width esc + 3: The first window takes up half of the screen verti…

Additionally you can cycle through these with +

Re: Tmux Tutorial

#28
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.

Re: Tmux Tutorial

#29
post #16

Earlier quoted context omitted.

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

Totally agree. Also, screen is usually default installed on fresh distros. You have to go out of your way to install tmux

> You have to go out of your way to install tmux

You have to type: apt install tmux. Or, whatever your distro of choice's package manager install line is. I'd hardly call that going out of one's way.

Re: Tmux Tutorial

#30
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.

I've been using screen for a while and came here to post the same question motivated by my thought that most likely we're probably not missing out on anything.
Post reply on HN