Hacker News new | ask | show | jobs
by asdff 2307 days ago
I tried to get into tmux but it started to get frustering as someone coming from using the native shell. I even fell down the rabbit hole of wonking with my tmux config, trying different versions, etc.

I just could not stand the mouse behavior, ultimately. Switched to screen for some things. Sometimes its just easier to use the trackpad to scroll than page up/down or select text with the cursor vs. with the keyboard. Can't do both in tmux; either you can scroll in programs and not in the shell, or loose 'modern' copy paste and select behavior with the mouse as well as scrolling in programs to get scrolling in the shell. I just couldn't figure out how to have it both ways like the native shell.

1 comments

You can but you need to change the mouse mode

In newer versions of tmux

   set -g mouse-mode on
   # make scrolling with wheels work
   bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
   bind -n WheelDownPane select-pane -t= \; send-keys -M
I'm getting invalid option: mouse mode in tmux 3.0a, and unknown option: mouse-mode in tmux 1.8.

That's the thing with these .tmux.conf hacks you see floating around github and stack overflow. The tmux devs changed the relevant settings practically every other release and offered no compatibility, so most of what you find just doesn't work with your build.

But even those snippets that do work with my builds, you can't have it all. Either scrolling up takes you past the panes and into the std output of the native shell, or you enable mouse mode and can scroll in your shell but loose the ability to scroll in editors like nano and programs like less.

Maybe if there was a way to automatically turn off mouse mode when running programs and flick it back on when exiting to the command line, but I'm not well versed enough in the .tmux.conf syntax to figure it out without too much trouble.

I created something that enables the scroll based on process name https://github.com/noscript/tmux-mighty-scroll
Ohh...nice. And to GP, if this doesn’t work well for you, try the combination of abduco and dvtm. Before I joined Red Hat, that was my terminal multiplexer combination of choice. However, because they’re in EPEL which most of my customers don’t use, I forced myself to revert to tmux. I remember initially missing abduco + dvtm but get 95% of what I want with tmux. abduco feel slightly better about maintaining session state.