brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: set -g mouse on lets you click panes, drag borders and scroll

Tmux
~/tips/tip-tmux-mouse-on

set -g mouse on

Turns on mouse support in tmux, so clicking selects panes and the wheel scrolls the history.

The first thing new users miss is the mouse wheel. One line in your config fixes that.

# ~/.tmux.conf
set -g mouse on

Reload the file and you can click a pane to focus it, drag a border to resize and scroll up with the wheel to enter copy mode. Check it with tmux show -gv mouse, which prints on.

I would turn this on straight away if you are new to tmux, and decide later whether you want it. The default keyboard way of scrolling is powerful but nothing you would guess, and the mouse wheel is what everyone tries first. With the option on, scrolling up enters copy mode on its own.

One trade-off: with mouse mode on, tmux handles the click and drag itself, so selecting text gives you tmux’s selection and not the one from your terminal app. That copy lands in tmux’s own buffer, which you paste with Ctrl-b ]. If that bothers you, turn the option off again and use the keyboard.

Many terminals let you hold Shift while dragging to use their own selection, but that differs per terminal.

Try it without risk: start a throwaway session with tmux new -s scratch, use the shortcut or command above there, look at what changes, and close the session again with tmux kill-session -t scratch. Nothing else on your machine is touched.

Further reading: tmux manual page (OpenBSD, official), tmux wiki: Getting Started (official), On this site: tmux list-keys | grep finds the binding you forgot, On this site: set -g status-position top moves the tmux status bar to the top

More Tmux tips tmux new -d -s report -x 200 -y 50 'top' tmux wait-for build-done set -g allow-passthrough on tmux kill-server Ctrl-b [ All Tmux tips (125) All topics

Link