DEV Community

Cover image for foot with true-color tmux support (à la Alacritty)
kdlr
kdlr

Posted on

foot with true-color tmux support (à la Alacritty)

I find foot, the default terminal in Wayland, either supremely underrated or SEO-proof due to its name. It's easy to configure and fast, and I especially love being able to include other files like color schemes. So when I started using tmux dailly I was dismayed I might have to switch to Alacritty or kitty for Neovim to look right, because Googling "foot ________" does not lead anywhere, and its documentation is a little on the thinner side. This humble first post of mine is an attempt to evangelize about this terminal and its flexibility.

The solution was pretty simple to figure out. I followed the conventional wisdom of setting TERM in Alacritty's env table, compared it to foot's config man page, and tried this:

[main]
term=xterm-256color
Enter fullscreen mode Exit fullscreen mode

TERM is the only possible field under the environment section, but the man page says "Note: do not set TERM here; use the term option in the main (default) section instead." I already had .config/tmux/tmux.conf configured with

set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
Enter fullscreen mode Exit fullscreen mode

and termguicolors set to true in Neovim.

Now tmux shows Neovim's lovely background colors on all three of my machines even when I connect to them remotely. Sans includes, my foot.ini is fewer than 20 lines:

# -*- conf -*-

[main]
term=xterm-256color
#font=Cozette:size=9
font=JetBrainsMono NF:size=12
pad=12x18
include=~/.config/foot/moonqueen.ini

[scrollback]
lines=100000

[key-bindings]
clipboard-copy=Control+Shift+c XF86Copy
clipboard-paste=Control+Shift+v XF86Paste

[colors]
alpha=0.9
Enter fullscreen mode Exit fullscreen mode

Here you can see two different Neovim colorschemes. The pink one reminds me that tmux panel is hosted by my headless server, while the indigo editor matches my client foot config and overall Sway styling.

tmux and neovim in foot

Top comments (0)