Top
Best
New

Posted by speckx 7 hours ago

Make Tmux Pretty and Usable (2024)(hamvocke.com)
231 points | 167 commentspage 2
yoyohello13 6 hours ago|
If you're interested in an out of the box multiplexer. https://zellij.dev/ is great. I've been using it for about a year now and loving it.
tosti 6 hours ago|
Your out of the box isn't my out of the box. Tmux is in main on OpenBSD, where it started.
tosti 6 hours ago||
I like having a red bar for tmux running as root and a blue one for running it as a normal user, e.g. for root:

    set -g status-style "bg=red"
I also like to have the bar on top and the status centered:

    set -g status-justify absolute-centre
    set -g status-position top
backwardsponcho 21 minutes ago||
Do you use this when running tmux remotely?

(I only run it in my own machines so it never runs as root anyway)

stonecharioteer 6 hours ago||
I change the color of the bar in every server I've set it up so I know absolutely where I am.
tosti 6 hours ago||
Aren't you going to run out of colors to pick?
Lindby 2 hours ago||
My approach is to color ssh sessions to prod servers red, less dangerous servers orange, my own non shared computers blue.
himata4113 6 hours ago||
I highly recommend just turning the mouse on, it's amazing for resizing panels and the rightclick menu is nice.

  set -g mouse on
for multi-monitor setups

  setw -g aggressive-resize on
is also really nice.
throwa356262 5 hours ago|
Honestly, this is the only configuration I need.

Wish they could make this default, not sure why they haven't.

himata4113 5 hours ago||
xterm, probably

a lot of servers use tmux which probably has some weird broken edge cases

jzer0cool 5 hours ago||
Could never get mouse copy to work well (using mac at moment). When I make text selection, selects yellow and upon release goes to terminal prompt. I had one config work at one point and it kept selecting from all panes, not just one the one I'm in. Any ideas?
douglee650 3 hours ago||
This is also why i gave up on it. Don't want to install iTerm either, more blaot.
never_inline 4 hours ago||
Try iterm2 which has mouse reporting
strogonoff 6 hours ago||
There’s many ways tmux could be used, but when it is part of IDE the most important usability tweaks that make tmux rock for me personally are:

— session configuration save/recall (with pane layout for each tab and directory for each pane[0]),

— nvim integration (for seamless split navigation and so that I can create or reattach to a tmux session in an nvim float, even though that nvim usually runs inside tmux),

— a bind to force-reload a pane if (when!) a command hangs.

For switching between tabs, I find that the ideal bind is simply Cmd + pane number. There’s never more than ten tabs that I’d often want to switch to within a single session. The highest number is probably four tabs. Each tab is typically assigned a high-level part of the project.

[0] I always forget what terminology a given multiplexer uses, so let’s just call them “panes” and “tabs”.

amdivia 3 hours ago||
My main gripe with tmux is the nested use case (tmux session on my local machine, in which I ssh to another machine, only to tmux attach within the remote machine too). Is there a terminal multiplexer/session daemon that supports nested sessions out of the box with ease?
she46BiOmUerPVj 2 hours ago|
I wrote quite a bit of configuration to support an "outer" tmux process and "inner" tmux processes on all the remote hosts I have various and different tasks to accomplish. I am not sure how some software would manage these, but in the very least configuring my outer session to use Ctrl+a while the inner one uses Ctrl+b is working well. I have aliases that specify a socket so I can refer to the sessions easily and not get them confused.
colton_padden 5 hours ago||
I prefer to hide the status bar entirely, and use an fzf-powered named window switcher to navigate between windows.

https://github.com/cmpadden/dotfiles/blob/6e767691a6b1295260...

thcipriani 4 hours ago||
Ctrl-a interferes with readline shortcuts. I've been using Ctrl-<Space>: nothing, as far as I know, binds to that.

    unbind C-b
    set-option -g prefix C-Space
    bind-key C-Space send-prefix
data-ottawa 10 minutes ago||
I very recently learned that with most readline apps and terminal password inputs, ctrl+u clears the input.

Very handy when you make a typo far into a long password and can't keep track of whether you've mashed backspace enough.

mhw 3 hours ago|||
I’ve been using Ctrl-s for years. Nothing else uses it because it’s historically been used for terminal flow control, but that doesn’t really have much use in a graphical terminal with history and scrollbars and so I’ve never missed it. Has similar two-finger ergonomics to the Ctrl-a bind as well.

edit: oh, and I think Ctrl-space is the keystroke to get a nul character, and vi uses that character to insert the last entered piece of text in insert mode. It looks like Ctrl-@ does the same things, but tmux might not be able to tell the difference either.

kombine 2 hours ago||
Same, I used C-a for a while until I found out its default mapping is jumping to the beginning of the line so I rebound tmux prefix to C-Space. Now my only problem is on a few servers where I haven't copied my dotfiles.
halfwhey 6 hours ago||
My two favorite tmux QoL improvements are enabling seamless navigation between neovim and tmux (there are many plugins but i use this one https://github.com/aserowy/tmux.nvim) and extrakto which lets you fuzzy select anything in the tmux buffer and insert into the cursor or copy it to the clipboard. (https://github.com/laktak/extrakto)
nickjj 4 hours ago|
One nice thing about tmux is it also supports include files in its config.

This lets you put your theme colors in a different file, such as `source-file "~/.config/tmux/theme.conf"` and then your theme switching external script or tool can symlink a specific theme's tmux file to that path.

That's what I do in my dotfiles:

    # Main tmux config
    https://github.com/nickjj/dotfiles/blob/master/.config/tmux/tmux.conf

    # One of the theme files
    https://github.com/nickjj/dotfiles/blob/master/themes/tokyonight-moon/tmux.conf
It allows for hot-reloading different themes as well.
More comments...