0

I'd like to change the background color of selections in Tmux. Which variable do I change for this?

1

There's more than one "selection": tmux has selections for its paste, etc, while the terminal has its select/paste which tmux knows nothing about:

0

In most terminals the selection color is generated by reverse video. This implies that you cannot set it. It is just swapped background and foreground color.

It is probably the responsibility of the terminal application, you use to set up the colors for the the contents. The exception is of course what tmux renders for its own elements (bars, borders, its own prompt, etc).

Look up background and foreground properties for your terminal and set them up in your ~/.Xdefaults file. On non-X terminals the termcap or certain environment variables files can be used for this.

0

You can change the styling of the text selection in tmux's copy mode by setting the mode-style option.

As of tmux version 3.2, the mode-style option has a default value of bg=yellow,fg=black.

I prefer my text selection to use the reverse video style (my terminal's configured default foreground and background colors reversed).

To achieve that styling for the text selection within tmux, I have the following line in my tmux.conf:

set -g mode-style 'reverse'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.