22

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.

0

1 Answer 1

32

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

5
  • Sometimes I inadvertently manage a few key presses and my borders switch from nice thin ones to these larger ones. I certainly didn't manage to type in a whole command like you've described above. Is there a shortcut that allows one to switch between the two? IIRC the last time it happened I managed some combination of <prefix>-w and when attending to exit the list view I did something. I think.
    – sherrellbc
    Sep 15, 2020 at 21:12
  • 4
    @sherrellbc The only standard shortcut that touches those attributes, AFAIK, is the "mark pane" shortcut, <prefix>-m, which calls select-pane -m. The target pane is "marked" by inverting its border colors. Depending on your chosen colors it might appear as if the borders get larger. It's a toggle so hit it again to disable.
    – B Layer
    Sep 16, 2020 at 9:00
  • Bingo. That was it. I wonder why you might want to mark a pane in this way. Incidentally it didn't have anything to do with the list view then. Thanks!
    – sherrellbc
    Sep 16, 2020 at 11:04
  • 2
    @sherrellbc Cool. The visual effect is mostly secondary to the main purpose of marking. Several commands will act on the marked pane as the "source pane" if a source is not explicitly specified. For example, you can run swap-pane or join-pane without the -s <pane> option if you've marked a pane. Combine that with having a different pane as the current pane and you can run some commands that operate on two panes without specifying any pane directly.
    – B Layer
    Sep 16, 2020 at 12:05
  • Ctrl+b and then m got rid of the thick borders. I assume m is for marked. Mar 5, 2021 at 10:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .