Adjust border thickness in tmux

tmux

By default, the active pane in tmux has a thin green border, as pictured below.

tmux with thin green borders

I tried to change the color by adding the following lines to ~/.tmux.conf:

set-option -g pane-active-border-style "bg=colour208"
set-option -ag pane-active-border-style "fg=black"

(colour208 is the shade of orange in the picture)
However, the new borders look like this:

tmux with thick orange borders

The orange highlighting is far thicker than the green highlighting there is by default. Is there any way to adjust this, so that the border color is orange, but the highlighting is still thin? I'm using tmux 2.5 on ubuntu 16.04.3.

Best Answer

Those border lines are made up of rows and columns in the console and they are indivisible. In a text-based terminal there is no structural element smaller than one character "cell" (which is about the size of that block cursor). The only way to reduce the size of the borders is to reduce the size of all rows/columns.

Fortunately, we can manipulate the colors to give the appearance of a thinner border: set the foreground to the desired color (colour208 in your case) and set the background to the background color of your panes. For the latter default is often sufficient.

That gives us...

set -g pane-active-border-style fg=colour208,bg=default

If there's a color mismatch replace default with the actual pane background color.

(You can, of course, configure the non-active borders similarly. Replace pane-active-border-style with pane-border-style and change the foreground color as desired.)

Here's a screen shot taken after I applied the above setting..

enter image description here

Update: I originally listed two ways to configure the border colors. The second way...

set -g pane-active-border-bg default
set -g pane-active-border-fg colour208

...should be avoided as it will no longer work in tmux 2.9 or later. The one exception is if you are using an ancient tmux build as the newer syntax isn't available prior to tmux 1.9

Related Question