home ~ projects ~ socials

Add Borders And Titles To tmux Panes

This isn't working as expected for updates with directories.

set -g pane-border-format " #{pane_current_path} "

but it's not working for me right now. It sticks on one path and doesn't change. The same thing happens if I try to run the pwd command via

set -g pane-border-format " #(pwd) "

Borders

Add this to your config to turn on borders:

~/.tmux.conf

set -g pane-border-status top
set -g pane-border-lines double
set -g pane-border-style fg=#447755
set -g pane-active-border-style fg=#447755

Automatic Titles

Titles can be added via the config with:

~/.tmux.conf

set -g pane-border-format " #{pane_current_path} "

Manual Titles

It's also possible to set a title manually for each pane. Run this inside the pane you want to update.

tmux select-pane -T "Some Title"

The sets the title to the current directory path of the pane. There's a bunch of other options in the man tmux page.

The available options for pane-border-lines are

  • single single lines using ACS or UTF-8 characters
  • double double lines using UTF-8 characters
  • heavy heavy lines using UTF-8 characters
  • simple simple ASCII characters
  • number the pane number

I've seen some notes saying that apps might overwrite the title you set. I haven't hit that yet, but it sounds like there are ways to prevent that listed in the manual page.

Notes

  • The dracula plugin prevented the border colors from working for me

    See also: -- id: 2t021hxc

-- end of line --

References