Live data from Hacker News

Using tmux properly

danielallendeutsch.com

41–50 of 218 posts

Re: Using tmux properly

#41
post #27

Earlier quoted context omitted.

How do you persist sessions between reboots?

The session doesn't actually persist between boots. I think what the parent must be referring to is the ability to create tmux session configurations. Then after a reboot if you try to connect to the session which no longer exists the conf will spin it up for you.

Gotcha. I'll have to look up some docs on that, sounds useful.

Re: Using tmux properly

#42
post #33

Yesterday I was helping a friend setting a box with no graphical session: I fired up tmux in the linux virtual terminal and then proceeded to realize without my tmux.conf I couldn't do a thing because I have always been using entirely different keybindings from the default. This is the problem with too much customization. Learning to use the default configuration may be difficult but it's probably worth the effort, f…

The thing about tmux bindings is that, as far as I know, very few people like the defaults.

I've taken the approach of 'learn the defaults' for vim, but on tmux that simply won't stand because the defaults have so much room for improvement.

Pretty much everything I've read on tmux suggests the - and | bindings for window splits, same goes for hjkl bindings for movement. Adding these bindings would go a long way towards standardizing tmux.

Re: Using tmux properly

#43

It still sounds like a very shallow (naive?) use of tmux to me, I'm in no way a real power user of tmux and I use a lot more feature than that. You could talk about binds without prefix, sessions, customized status bar, pane swapping, bind keys to script launching, plugins, pane highlighting... And the best feature of all for me: maximized pane toggle. I use that ALL the time. I never could find all features I needed…

You sound very smart. I think you are a power user, and a smart person.

Re: Using tmux properly

#44
post #42
post #33

Yesterday I was helping a friend setting a box with no graphical session: I fired up tmux in the linux virtual terminal and then proceeded to realize without my tmux.conf I couldn't do a thing because I have always been using entirely different keybindings from the default. This is the problem with too much customization. Learning to use the default configuration may be difficult but it's probably worth the effort, f…

The thing about tmux bindings is that, as far as I know, very few people like the defaults. I've taken the approach of 'learn the defaults' for vim, but on tmux that simply won't stand because the defaults have so much room for improvement. Pretty much everything I've read on tmux suggests the - and | bindings for window splits, same goes for hjkl bindings for movement. Adding these bindings would go a long way towar…

Yeah, I learned screen defaults, so ^A is far too strong of a habit to change.

Re: Using tmux properly

#45
post #33

Yesterday I was helping a friend setting a box with no graphical session: I fired up tmux in the linux virtual terminal and then proceeded to realize without my tmux.conf I couldn't do a thing because I have always been using entirely different keybindings from the default. This is the problem with too much customization. Learning to use the default configuration may be difficult but it's probably worth the effort, f…

I think the time I've saved by customizing my tmux far outweighs any time I've lost when clumsily using it on a server.

Re: Using tmux properly

#46
post #33

Yesterday I was helping a friend setting a box with no graphical session: I fired up tmux in the linux virtual terminal and then proceeded to realize without my tmux.conf I couldn't do a thing because I have always been using entirely different keybindings from the default. This is the problem with too much customization. Learning to use the default configuration may be difficult but it's probably worth the effort, f…

I 120% agree.

I once lost my emacs dotfile and suddenly i was almost unable to use Emacs on my own pc.

Since then, i've decided to apply as little customisation as possible to software I use, and read the documentation and learn the standard configuration instead.

For some reasons nowadays it's trendy to add colors, bells and whistles to things but I've found out that learning the standard/default configuration lets me be instantly capable of intervention on whatever machine i put my hands on. Worst case scenario, i can tell programs to ignore configuration files.

Re: Using tmux properly

#47

The big problem I always have with tmux is that is messes up all of the colors in my Vim.

Whatever TERM is set for you outside tmux needs to have a full ncurses terminfo with all the extended ncurses-specific codes. Assuming that screen and screen-256color on your system is similarly fully-featured with respect to ncurses, then you'll be in a good position. If you're lucky, TERM=screen-256color inside tmux and you're good to go.

Without that, there are a variety of hacks at different levels of the processing stack you can use to fix things. You could set TERM to screen. if your system has the right settings for screen.; or you could try setting it to if is sufficiently xterm-like.

Re: Using tmux properly

#48
My favorite tip: add bindings with the control key. So if you use "Ctrl-b n" to go to the next pane, add a binding for "Ctrl-b Ctrl-n". It's easier to keep the Ctrl key pressed than to lift it.

Re: Using tmux properly

#49
post #33

Yesterday I was helping a friend setting a box with no graphical session: I fired up tmux in the linux virtual terminal and then proceeded to realize without my tmux.conf I couldn't do a thing because I have always been using entirely different keybindings from the default. This is the problem with too much customization. Learning to use the default configuration may be difficult but it's probably worth the effort, f…

It gets worse when you work in ops and are constantly needing to remote into servers and you regularly have tmux within a tmux within a tmux... Littering config files across the datacenter just isn't an option.

Re: Using tmux properly

#50
post #32

Does mouse copy and paste work correctly with tmux? I find that it selects spans across multiple panes. Is there a way to fix this or Windows or Linux?

Another option is to write the tmux buffer to pbcopy on a Mac or xclip or something similar in Linux
Post reply on HN