4 ms·
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
by anyfoo 2y ago
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.
- callc 2y agoTry “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.
- anyfoo 2y agoThat 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...
- Panzer04 2y agoLogitech 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.
- dev-ns8 2y agoI 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
- Tsiklon 2y agoHave 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
- anyfoo 2y agoI 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.
- tambourine_man 2y agoI’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
- acomjean 2y agoI 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.
- dev-ns8 2y agoScrolling 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?
- axiolite 2y agoIt'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
- pfranz 2y agoiTerm2 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 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.
- olegdotcom 2y agoI 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 https://github.com/shell-pool/shpool), which checks all the checkboxes you mention.
- tambourine_man 2y agoshpool 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.
- saurik 2y agoI am pretty sure dtach is in Homebrew, but maybe you specifically like the exact set of tradeoffs from shpool.
- axiolite 2y ago> * 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
- macartain 2y agoNot 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..
- mcspiff 2y agoIt’s not perfect, but I’ve found wezterms multiplexer quite good for this: https://wezterm.org/multiplexing.html https://wezterm.org/multiplexing.html
- PhilipRoman 2y agoRegarding scrolling, I just have a keybind which dumps the scrollback buffer into vim in a new window. Works great for copying or searching things.
- philo_sophia 2y agoTmux 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 https://github.com/tmux-plugins/tmux-yank
- PhilipRoman 2y agoAs 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
- philsnow 2y ago> 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?
- kitd 2y agoTerminator? You can split/configure your terminals anyhow, and save your setup for future reference.
- philo_sophia 2y agoDisclaimer: 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 https://github.com/tmux-plugins/tmux-yank