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: tmux select-pane -d stops a pane from taking your typing

Tmux
~/tips/tip-tmux-read-only-pane

tmux select-pane -d -t 2

Protects a pane, such as a running job, from stray keystrokes.

With synchronize-panes or a quick pane switch, it is easy to type into the wrong place. For a pane that runs something you don’t want to disturb, you can switch its input off.

tmux select-pane -d -t 2

Pane 2 keeps running and keeps printing, but tmux drops every key you send to it. To turn input back on:

tmux select-pane -e -t 2

Without -t it applies to the current pane, so Ctrl-b : and select-pane -d works too. Then you notice that you can’t type your way back out, which is why I’d keep a key for each:

bind P select-pane -d
bind O select-pane -e

The prefix keys still reach tmux, so Ctrl-b O unlocks the pane you are in. To check whether a pane is locked, ask for #{pane_input_off} with display-message -p; it prints 1 when input is off.

It only blocks input. The program in the pane keeps running and printing, and Ctrl-b x still closes the pane, so it guards against typos rather than against you.

Further reading: tmux manual page (OpenBSD)

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