Live data from Hacker News

Tmux Tutorial

leimao.github.io

11–20 of 166 posts

Re: Tmux Tutorial

#11

One of the downsides listed when you don't use tmux is that you have to type your password for each terminal you open to the remote machine. Does no one use ssh-agent?

This somewhat painfully breaks when reattaching as the socket from the shells environment could be defunct. Whereas the shell session outside has a different, totally fine agent in its environment. This was somewhat painful to explain to some engineers and I suck at explaining so I’ll gladly receive a good explanation for it (or a nice workaround?) :D

Re: Tmux Tutorial

#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 vertically, and all remaining windows divide up the space equally

esc + 4: The first window takes up half of the screen horizontally, and all remaining windows divide up the space equally

esc + 5: Windows are divided into two equal columns horizontally, and split remaining space vertically.

Even if I have to alter the sizes a bit usually, the pre-defined layouts are super useful for positioning different windows.

Re: Tmux Tutorial

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

Does screen offer splits? Those are game changing for me. I can't go back to screen without then.

Yes, vertical and horizontal

Re: Tmux Tutorial

#14
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 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?

Re: Tmux Tutorial

#15
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 they mean tmux is not installed on the remote machine but screen is, so screen is inside the ssh session, inside the tmux session

Re: Tmux Tutorial

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

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

Re: Tmux Tutorial

#17

Another alternative is emacs server.

I run both.

Emacs's terminal emulator is almost correct but last few times I tried to use it I had trouble with certain curses-based programs.

Also, disconnecting tmux UI (and even restarting X) does not affect the session, and you can reconnect. Unfortunately, I was not able to reproduce it with Emacs for some reason, though it should be possible.

Re: Tmux Tutorial

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

Meaning what? It's different?

Re: Tmux Tutorial

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

Re: Tmux Tutorial

#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!
Post reply on HN