News for hackers. Stuff that matters.
Re:Tmux – The Essentials (2019) by anyfoo on Tuesday March 04, 2025 @09:30PM (#43261906)
I like tmux a lot, but like its predecessor "screen" I mostly use it for explicitly running long-lived jobs (i.e. for its detach feature), and for very special situations where I have elaborate tmux window configurations with dedicated stuff running in each window/pane.

Note that I have been using text-only terminals since the 1980s, but I've adapted my tty usage over time.

The problem that tmux (or screen) brings are first and foremost:

* Smooth/fast scrolling goes away. I can no longer give my trackpad a slight push to find myself tens or hundreds of lines in the scrollback history, and visually scan by slightly pushing my fingers back and forth. Instead I have to use the horrendous in-tmux scrollback using "Ctrl-b [".

* My terminal app's tabs and windows are not tmux's tabs and windows. I cannot freely arrange them in space, snap them off with the mouse, easily push them to another desktop, and so on. I have to start a multiple tmux clients and do awkward keyboard interactions with them for any of the same.

* tmux's terminal emulation and my terminal emulator's terminal emulation (heh) are not congruent. As a result, programs cannot make full use of my actual terminal's capabilities. For example selecting, copying, and pasting text sometimes behave weirdly, and there are other annoyances.

What I'd really like to have instead is terminal session management at a higher level, i.e. involving my actual graphical terminal app itself. Attaching to a running session would mean restoring the terminal app's windows and tabs, and the entire scrollback history within (potentially with some lazy loading).

tmux could likely be a major part of that, by providing the option of replacing its tty-facing frontend with a binary protocol that the graphical terminal app talks to, while keeping the backend (i.e. the part that provides the tty to anything running inside it) the same as it is today.

As it is, the downsides of using tmux all the time are too high.

Re:Tmux – The Essentials (2019) by olegdotcom on Tuesday March 04, 2025 @10:47PM (#43262480)
I have the same exact gripes with tmux/screen, and I have a similar workflow requirements as you do. I'm currently using Shpool (https://github.com/shell-pool/shpool), which checks all the checkboxes you mention.
Re:Tmux – The Essentials (2019) by tambourine_man on Tuesday March 04, 2025 @10:57PM (#43262564)
shpool is great, but it’s still Linux-only AFAIK. There was a Mac port coming along last I checked, but I don’t know the current status.
Re:Tmux – The Essentials (2019) by saurik on Wednesday March 05, 2025 @03:04AM (#43264041)
I am pretty sure dtach is in Homebrew, but maybe you specifically like the exact set of tradeoffs from shpool.
Re:Tmux – The Essentials (2019) by pfranz on Tuesday March 04, 2025 @10:32PM (#43262349)
iTerm2 has had Tmux Integration for a few years now. That's not something I want, so I'm not sure if it ticks all your boxes.

https://iterm2.com/documentation-tmux-integration.html

Other terminal emulators offer similar features to Tmux. For example, Kitty claims to support Tmux's features outside of remote persistence.

Re:Tmux – The Essentials (2019) by callc on Tuesday March 04, 2025 @09:37PM (#43261954)
Try “set-option -g mouse on” in your ~/.tmux.conf. I’ve never used the copy/scroll mode, always use scroll wheel on mouse.

Yeah, copying can be weird. I full screen a panel to copy multiple lines of text using the terminal emulator’s copy, not tmux’s. Works well enough.

Re:Tmux – The Essentials (2019) by anyfoo on Tuesday March 04, 2025 @09:40PM (#43261976)
That is a far, far cry from using kinetic scrolling. In fact, using a mouse wheel is a very far experience away from that. I basically cannot use "normal" mouses with scroll wheel anymore for that reason, I couldn't get anything done like that.

I think there are/used to be some mice with a ultra-low-fricton "freerunning" scroll wheel. I guess that could be a similar experience, but of course tmux would stand in the way of that as well.

And I'm very old school and had been using text-only terminal starting in the 1980s...

Re:Tmux – The Essentials (2019) by Panzer04 on Tuesday March 04, 2025 @11:42PM (#43262894)
Logitech MX3 is the modern version, not sure what else there is. It's got a magnetic mechanism that allows the scroll wheel to freewheel if you want.
Re:Tmux – The Essentials (2019) by dev-ns8 on Tuesday March 04, 2025 @10:34PM (#43262365)
I have been wrestling with having to enter scroll mode for so long now. It's so infuriating. It works without configurations on iTerm, but does not work on a single other terminal emulator I've tried.

I just tried your config setting in Ghostty and still, when I use my mouse it scrolls through zsh history, not the screen

Re:Tmux – The Essentials (2019) by dev-ns8 on Tuesday March 04, 2025 @10:35PM (#43262382)
Scrolling behavior is one of my biggest gripes with tmux. I've not done enough digging on terminal emulators and multiplexers to know why this is.

Is this an inherent limitation of multiplexers or does it stem from a choice made by tmux?

Re:Tmux – The Essentials (2019) by axiolite on Wednesday March 05, 2025 @12:34AM (#43263245)
It's a choice. tmux uses the "alternate screen" capability, the same way editors like "vi" do, which (according to man tmux): "preserves the contents of the window when an interactive application starts and restores it on exit, so that any output visible before the application starts reappears unchanged after it exits."

To change that behavior, put the following in your tmux.conf:

    set -g terminal-overrides '*:smcup@:rmcup@'
    set -g status off
Re:Tmux – The Essentials (2019) by Tsiklon on Tuesday March 04, 2025 @09:37PM (#43261955)
Have you enabled mouse mode in your tmux configuration? I’ve found it to have none of the scroll issues you describe on my Mac and Linux systems
Re:Tmux – The Essentials (2019) by anyfoo on Tuesday March 04, 2025 @09:46PM (#43262018)
I have. It's not even closed to the kinetic scrolling experience of native Terminal.app. It simultaneously scrolls one whole line at a time (instead of using pixel granularity), and ignores the terminal app's scroll bar indicator, which effectively means that if I give my trackpad a slight push in either direction, I get what looks like random flickering instead of the very natural and intuitive scrolling with a subconscious idea of where I am in a long buffer that any native macOS app, including the terminal emulators, give me.
Re:Tmux – The Essentials (2019) by tambourine_man on Tuesday March 04, 2025 @10:51PM (#43262515)
I’m with you, smooth scrolling and copying/selecting is what’s been keeping me from using tmux full time all of these years.

I just wish Terminal.app had vertical splits and true colors. It’s just embarrassing that Apple hasn’t touched it in such a long time. I’ve been looking for a better terminal emulator for years and tried pretty much all of them, but begrudgingly end up back at Terminal.app

Re:Tmux – The Essentials (2019) by acomjean on Tuesday March 04, 2025 @11:22PM (#43262750)
I don’t love the scroll back on tmux. I found I was often using it with emacs in one window and a shell in another. On the ocations where I needed huge scroll back I would use emacs in both and would M-X shell and have a whole output buffer with emacs’s almost endless scroll. Of course emacs shell isn’t great… but it’s searchable and savable.
Re:Tmux – The Essentials (2019) by axiolite on Wednesday March 05, 2025 @12:28AM (#43263197)
> * Smooth/fast scrolling goes away.

That was the first thing I looked-up how to fix (years ago). Put the following in your tmux.conf:

    set -g terminal-overrides '*:smcup@:rmcup@'
    set -g status off
Re:Tmux – The Essentials (2019) by macartain on Wednesday March 05, 2025 @09:30AM (#43266880)
Not sure what this is tweaking (I'll check) but this does not seem to affect the described behaviour.. PgUp/Down does nothing - with and without shift - and mousewheel still just scrolls thru shell comand history and I need to use Ctrl-B ] to get into session output history..
Re:Tmux – The Essentials (2019) by mcspiff on Wednesday March 05, 2025 @01:12AM (#43263449)
It’s not perfect, but I’ve found wezterms multiplexer quite good for this: https://wezterm.org/multiplexing.html
Re:Tmux – The Essentials (2019) by PhilipRoman on Wednesday March 05, 2025 @01:44AM (#43263600)
Regarding scrolling, I just have a keybind which dumps the scrollback buffer into vim in a new window. Works great for copying or searching things.
Re:Tmux – The Essentials (2019) by philo_sophia on Wednesday March 05, 2025 @04:37PM (#43272887)
Tmux allows reverse search of the text on the screen and add the tmux-yank plugin to directly copy highlighted text onto your system clipboard

https://github.com/tmux-plugins/tmux-yank

Re:Tmux – The Essentials (2019) by PhilipRoman on Thursday March 06, 2025 @02:55AM (#43277611)
As far as I know tmux already copies things straight to X11 clipboard by default (at least in version 3.5a) and no configuration aside from enabling mouse is necessary.

For me, customized Vim search is just miles ahead of everything else so I prefer that (not just for the search, but also to open files with gF, etc.).

I also have a couple binds in Vim to deal with tmux:

    vnoremap <leader>ty "ty:call system('tmux loadb -', getreg("@t"))<cr>
    nnoremap <leader>ty "tyiw:call system('tmux loadb -', getreg("@t"))<cr>
    nnoremap <leader>tp :let @t=system('tmux showb')<cr>"tP
Re:Tmux – The Essentials (2019) by philsnow on Wednesday March 05, 2025 @04:47AM (#43264739)
> What I'd really like to have instead is terminal session management at a higher level, i.e. involving my actual graphical terminal app itself. Attaching to a running session would mean restoring the terminal app's windows and tabs, and the entire scrollback history within (potentially with some lazy loading).

Do you mean something like Xpra, x2go, NX, VNC, or Parsec?

Re:Tmux – The Essentials (2019) by kitd on Wednesday March 05, 2025 @06:24AM (#43265282)
Terminator? You can split/configure your terminals anyhow, and save your setup for future reference.
Re:Tmux – The Essentials (2019) by philo_sophia on Wednesday March 05, 2025 @04:43PM (#43272967)
Disclaimer: I generally prefer doing everything by keyboard and never touching a mouse

When you enter tmux scroll back buffer with "Ctrl-b [" you can reverse search the entire output and navigate within the buffer with standard shortcuts (same as man pages). I also added this yank plugin to copy any highlighted output to my system clipboard. Makes searching and copying output super fast

https://github.com/tmux-plugins/tmux-yank