Live data from Hacker News

Using tmux properly

danielallendeutsch.com

11–20 of 218 posts

Re: Using tmux properly

#11
I have my tmux/vim set up so that C-(h,j,k,l) navigates vim splits and tmux panes seamlessly. The only downside was that I had to rebind C-l to C-o to clear my shell. But it makes it a lot more productive when using multiple shell panes along with my vim session in one terminal window.

Re: Using tmux properly

#12

A big thing I've done is use my multiplexer segregate contexts. When I spin up screen (tmux would work the same, just never switched) I set an environment variable noting the particular context I'm working in, and I adjust my PATH, HISTFILE, and more based on this variable.

I create new sessions and name them appropriately. My one wish is to be able to do "PREFIX ls" and then just hit enter on the session to switch to. I may be missing something, but I always have to do "PREFIX a -t [session name]".

You don't use PREFIX s ? Just select by name and hit enter.

Re: Using tmux properly

#13
post #9

So "properly" means customizing to user preference?

If that means in contrast to the default configuration, then probably yes. tmux default is not bad, but each person would probably do better with a few common adjustments, and maybe a bit more for their local needs and focus.

Re: Using tmux properly

#14
post #3

There is one thing I want from my terminal multiplexer: working scroll functionality with Shift+PgUp/PgDn, even in split screens, just like in a plain console, without messing everything up. Is that possible?

Does it absolutely have to be a combination of Shift and PgUp/PgDn?

With tmux, you can type your prefix key followed by PgUp and it will scroll up, even in split screens.

For example, if your prefix key is Control-b, you would type Control-b PgUp and get the effect you want.

Re: Using tmux properly

#17
post #3

There is one thing I want from my terminal multiplexer: working scroll functionality with Shift+PgUp/PgDn, even in split screens, just like in a plain console, without messing everything up. Is that possible?

You do one better - tmux's mouse mode allows you to scroll with your mouse wheel. Just add 'set -g mouse on' to your ~/.tmux.conf. You can configure the history size limit by setting 'set-option -g history-limit '. When you scroll the mouse wheel, tmux will enter copy mode and scroll.

That is absolutely not 'better', sorry. Taking your hands off the keyboard to do something basic is never better.

Re: Using tmux properly

#18
echo "alias tmux='screen'" >> ~/.bashrc && source ~/.bashrc

But in all seriousness, I do sometimes find myself using tmux, but I try hard not to fragment myself over tools too much, especially with screen finally having vert split, and tmux being BSD, this is one of those cases where I think screen while it has some quirks and may have a bit of a learning curve is worth the effort.

edit: Since I didn't provide much value and my comment was a bit snarky, here is a truly useful tmux shortcuts and cheatsheet link:

https://gist.github.com/mischapeters/462c6f383bfd9b2f9eea3fb...

Re: Using tmux properly

#19
post #3

There is one thing I want from my terminal multiplexer: working scroll functionality with Shift+PgUp/PgDn, even in split screens, just like in a plain console, without messing everything up. Is that possible?

Does it absolutely have to be a combination of Shift and PgUp/PgDn? With tmux, you can type your prefix key followed by PgUp and it will scroll up, even in split screens. For example, if your prefix key is Control-b, you would type Control-b PgUp and get the effect you want.

I'd like to use the same key combination, no matter if I'm in screen/tmux or not.

Re: Using tmux properly

#20

What's the advantage of tmux over something like terminator with pane splitting?

I can SSH to a machine and connect to a tmux session. Tmux's competition is not terminator, but screen.

screen + dvtm, as I hear tmux has sensible way to manage split windows, while screen's way is atrocious.
Post reply on HN