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 default-terminal tmux-256color fixes broken colours in tmux

Tmux
~/tips/tip-tmux-default-terminal

set -g default-terminal "tmux-256color"

Tells programs inside tmux the right terminal type, so colours and keys work as expected.

Colours that look wrong in Vim or htop inside tmux often come from the wrong terminal type.

set -g default-terminal "tmux-256color"

tmux sets TERM for the programs in its panes to this value. tmux-256color describes what tmux can do, and most current systems have its terminfo entry installed.

Check with infocmp tmux-256color. If it prints an entry, you can use it. If it says the terminal type is unknown, use screen-256color, which exists almost everywhere.

True colour needs an extra line for your terminal, which depends on what TERM it reports outside tmux. Check that part against the tmux wiki before you copy a line from a forum.

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 it 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)

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