Live data from Hacker News

Make tmux pretty and usable (2024)

hamvocke.com

151–160 of 285 posts

Re: Make tmux pretty and usable (2024)

#151
One thing that often gets overlooked in the tmux vs. alternatives debate is that tmux's staying power is largely about ubiquity on remote servers. Zellij is great on your local machine where you control the environment, but if you're doing a lot of work via ssh on machines you don't own, tmux is almost certainly already installed. The muscle memory transfers too.

That said, I'd push back on the idea that the default tmux config is just "ugly". The real usability issue is that the keybindings are so divorced from how people intuitively think about splits and windows that even experienced users can't remember them. The visual defaults are just a symptom of the deeper problem that it was designed for someone who already had a mental model built around screen.

Re: Make tmux pretty and usable (2024)

#152

I left tmux for zellij after several unsuccessful attempts to get Shift+Enter working. Was quite impressed initially and invested weeks in building new muscle memory, but somehow Zellij crashed with panic more than once, leaving all my processes orphaned. Decided to go back to tmux, and found a simple fix for my Shift+Enter issue. In case anyone is looking for it, the fix is "bind-key -T root S-Enter send-keys C-j" b…

What does shift-enter do for you?

Maybe some keybind in a software. Another mentions Claude code, so it may be used to enter new line where enter is bound to send the prompt.

Terminal programs don’t see key events. It’s all text. I just checked st (suckless) code and the RETURN key will send “\r” aka carriage return. Control+j is “\n” or line feed.

Re: Make tmux pretty and usable (2024)

#154
post #13

I stopped using tmux when I started using kitty terminal with native split windows. I prefer the native window management of kitty, but I do miss the session saving of tmux (e.g. if I accidentally close a tab).

Recent versions of Kitty have sessions. https://sw.kovidgoyal.net/kitty/sessions/

I was going to say, but zellij doesn't connect the session to the GUI. However, I did not know about kitty's --use-foreground-process, which doesn't solve the problem completely but may be good enough.

https://sw.kovidgoyal.net/kitty/sessions/#more-complex-sessi...

Re: Make tmux pretty and usable (2024)

#155
post #61

Earlier quoted context omitted.

That may work for a server or two but doesn't really pan out for fleet management.

Volunteer to be the official image maintainer - I had emacs-nox and (screen) installed fleet wide for my own utility :) I had a friend that even had his public keys added to the /root/.ssh/ but I didin't go that far -I didn't even put my own .emacs out - but I at least could use good tools to look at the tcpdump output or giant log files if needed. "Eight Megs and Constantly Swapping" is not that big of a deal anymor…

This will definitely work, but it's not really even necessary. Just have some pre-connect script, that checks if the host is already "configured", and if not, then one-shot some Ansible playbook (or bash even) that installs what's needed. Use /tmp if root is not available. Also works for Kubernetes, though there we have better options.

Re: Make tmux pretty and usable (2024)

#156

I love tmux! It's perfectly usable! You only need a 400-line custom-built configuration file[1]! [1] https://doc.xn0.org/.tmux.conf Disclaimer: I am being silly but serious. tmux is absolutely not user-friendly out of the box. It is, however, extremely nice after an absurd amount of tweaking, which is either an endorsement or a damning, depending on your perspective.

Mine is only a few lines copied from jcs’s one.

https://github.com/jcs/dotfiles/blob/master/.tmux.conf

I’ve only reverted the prefix binding back.

Re: Make tmux pretty and usable (2024)

#157
post #88

I love tmux but one thing which really annoys me is the fact that I cannot use the mouse wheel or the scroll back to see the previous content. I know there are shortcuts to go forward and back but I always forget them and they are not easily accessible on my keyboard and cumbersome.

I think the mouse wheel is mapped by default if you `set mouse on`? I also additionally map Shift-PageUp/Down in my config. And recently they added a `pane-scrollbars` option for a clickable ASCII scrollbar.

Re: Make tmux pretty and usable (2024)

#158
post #98
post #27

I appreciate that tmux has theoretical advantages over screen, but man does the implementation suck. On Mac it still seems like there's no way to copy text if you have mouse mode on (at least in code-server).

Often, holding down "Shift" while making mouse selections will "break through" and let you get at the O.S. copy/paste/selection mechanism. Highly terminal dependent, though!

Not in browsers, unfortunately. Both my work and Home Assistant OS use tmux in a browser tty, and I have to turn off mouse mode to copy.

Re: Make tmux pretty and usable (2024)

#159

Earlier quoted context omitted.

If only we had ways to automate repeating processes… oh well

No, wanting to keep things vanilla when you're dealing with lots of random servers is a valid concern. Just because you can solve this with shell scripting doesn't mean you should.

You could always copy the config to /tmp and use the -f flag.

Re: Make tmux pretty and usable (2024)

#160
post #27

I appreciate that tmux has theoretical advantages over screen, but man does the implementation suck. On Mac it still seems like there's no way to copy text if you have mouse mode on (at least in code-server).

Maybe you could try this - https://github.com/tmux-plugins/tmux-yank

I haven't tried it, but it looks like it just calls pbcopy, which won't work in a browser. There's no programmatic way to do it, because tmux can't access the clipboard.
Post reply on HN