Live data from Hacker News

Tmux Tutorial

leimao.github.io

141–150 of 166 posts

Re: Tmux Tutorial

#141
What's the fastest way to scroll back through terminal history? Native scrolling doesn't appear to work and you have to annoyingly enter copy mode first?

Re: Tmux Tutorial

#142
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'm a long-time screen user, and I recently switched to tmux purely because it seems to handle high-color and unicode more cleanly than screen. I configured it to completely replicate my screen setup so that I didn't have to learn anything.

One thing I had in screen that I think tmux doesn't support is ..."stack keys"?

e.g., in screen I could configure "^a j p" to do one command and "^a j d" to for another:

> bind j command -c foo

> # CMD KEY NAME CMD

> bind -c foo p screen -t '% |db' make db

> bind -c foo d screen -t '% |prod' ssh prod

If that's possible, I'd love to know how. It's what stopped me from switching a few months ago, and is now the most painful change after switching again a couple days ago.

Re: Tmux Tutorial

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

Ditto. I like the logging capabilities and multiple pane capabilities in tmux better than I do in screen.

Re: Tmux Tutorial

#144

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.

Yes! And it works on remote machines too! SSH somewhere and give it a try

Re: Tmux Tutorial

#145
post #141

What's the fastest way to scroll back through terminal history? Native scrolling doesn't appear to work and you have to annoyingly enter copy mode first?

With `set -g mouse on` in ~/.tmux.conf, scrolling via mouse/touchpad works, at least in my setup.

Re: Tmux Tutorial

#146

Another alternative is emacs server.

I've actually started using vim with its :term feature as a terminal manager. So, I'll run screen (and tmux should work as well), and then run vim in a single window. Then I can run :term to open a terminal window within vim and then use use different terminal windows to do my work.

As far as I know, M-x shell doesn't allow for running multiple shell buffers in emacs, but :term in vim will allow you to do so.

Re: Tmux Tutorial

#147

Never understood why tmux had to be different and use ctrl+b when ctrl+a is already standard and much, much better.

isn't ctrl+a the BASH default for 'go to the beginning of the line'?

It is. If you're using screen, you can press ctrl-a a to send ctrl-a to readline to go to the beginning of the line. ctrl-b will actually move back a single character. Presumably, you could do something like ctrl-b b in tmux to move back one character, but I haven't tried it, so I don't know if that would work.

Re: Tmux Tutorial

#148
This is an acceptable tutorial but it could use a bit of editing to make the English more idiomatic. Also, except for the bit on plugins, I don't think it adds to or simplifies the man page.

Re: Tmux Tutorial

#149
post #68

Earlier quoted context omitted.

Exactly! Have you found any decent replacement?

I use a backtick, but don't edit much e.g. markdown in my tmux sessions, and always use $(...) for command substitution so I don't normally feel any pain. One oddity with tmux is that to escape the control character you don't press it twice, you press the escape char then ctrl-b, so that is a lot of extra movement around the keyboard

Could you bind prefix + ` to insert a literal backtick? I've only ever used the default ctrl-b prefix so I'm not sure.

Re: Tmux Tutorial

#150

Earlier quoted context omitted.

tmux -CC really is great on mac, but if it worked with mosh it would be incredible.

EternalTerminal works great as a mosh alternative and fully supports tmux -CC Alternatively, there's apparently a forked version of mosh out there with iterm2 support hacked in, but I've not tried it.

The real purpose of mosh is to make remote sessions usable over extremely poor connections (i.e. high latency and loss). EternalTerminal doesn't make your session work nicely from an airplane like mosh does.
Post reply on HN