[tmux] Fix true color support, especially in nvim

Tmux needs Tc set to enable truecolor support. At the same time, the
file was setting the same variable multiple times and in illogical ways.
So it now gets the term env var from the actual variable and simply adds
truecolor support.

Also removed cursor switching support for nvim, since tmux seems to
support it natively now. If it does not, this needs to be reinstituted.

Following discussions here:
https://www.reddit.com/r/neovim/comments/825dj7/the_endless_litany_of_tmux_and_nvim_color_problems/
and here:
https://stackoverflow.com/questions/41783367/tmux-tmux-true-color-is-not-working-properly
This commit is contained in:
Marty Oehme 2020-02-20 20:43:34 +01:00
parent 4e8be2abf2
commit 167744e8c8
No known key found for this signature in database
GPG key ID: 0CCB0526EFB9611A

View file

@ -21,12 +21,16 @@ setw -g pane-base-index 1
set -g renumber-windows on set -g renumber-windows on
# Terminal improvements # Terminal improvements
set -g terminal-overrides "xterm*:XT:smcup@:rmcup@"
set-window-option -g automatic-rename on set-window-option -g automatic-rename on
set-option -g set-titles on set-option -g set-titles on
set -g mouse on set -g mouse on
# set -g default-terminal xterm-256color set -s default-terminal $TERM
set -g default-terminal tmux-256color # allow truecolor support
set -as terminal-overrides ",*:Tc"
# Set Cursor terminal override, so nvim can change cursor style when changing modes
# more info see nvim, :help tui-cursor-shape
# LEGACY: this should not be necessary anymore
# set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
set -g status-keys vi set -g status-keys vi
set -g history-limit 10000 set -g history-limit 10000
@ -38,11 +42,6 @@ setw -g aggressive-resize on
# No delay for escape key press # No delay for escape key press
set -sg escape-time 0 set -sg escape-time 0
# enable true color support for nvim
set -ga terminal-overrides ',xterm-256color:RGB'
# Set Cursor terminal override, so nvim can change cursor style when changing modes
# more info see nvim, :help tui-cursor-shape
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
#################### ####################
## 2. PLUGINS ## ## 2. PLUGINS ##