Kitty Tmux Color when do SSH
huyhoang8398 opened this issue · comments
Hi @bluz71,
This issue is not for neovim but since I like your colorscheme and also you provide a configuration for Kitty terminal
I have a weird color when using SSH with vim and searching as the picture below: ( it's really hard to to see the text under the matching pattern )
My Tmux configuration is simple:
set -g default-terminal "tmux-256color" # for kitty
unbind C-b
set -g prefix `
bind-key ` last-window
bind-key e send-prefix
set -g status-position bottom
# Transparent background
set-option -g status-style bg=default
set -g status-fg "#bdbdbd"
set -g status-left ''
set -g status-right '%H:%M:%S'
set -g status-right-length 50
set -g status-left-length 20
setw -g mode-keys vi
setw -g window-status-current-format ' #I#[fg=#85dc85]:#[fg=#85dc85]#W#[fg=#ff5454]#F '
setw -g window-status-format ' #I#[fg=#bdbdbd]:#[fg=bdbdbd]#W#[fg=#bdbdbd]#F '
set-option -g history-limit 5000
# mouse behavior
set -g mouse on
set -s escape-time 10 # faster command sequences
set -sg repeat-time 600 # increase repeat timeout
bind-key -T copy-mode-vi 'v' send -X begin-selection # Begin selection in copy mode.
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
my workaround solution is :set background=dark
whenever I enter vim in tmux ssh session
I already set background=dark
here. You should not need to do that.
Does the issue happen outside of tmux? If not, then tmux and its configuration is likely your issue.
If issue still persists then your issue may well be TERM
related, for kitty that should be TERM=xterm-kitty
. Please make sure xterm-kitty
terminfo entry is installed on the remote host in that case.
Does the issue happen with other terminals? Alacritty? (which is the terminal I use).
For now, I don't believe the issue is colorscheme related.
This is an issue you will need to explore and fix, from my testing of Alacritty-with-tmux-over-SSH-using-Vim, I can not replicate your issue.
I am an Alacritty user (not kitty), but I do not believe that is the issue. More likely, some form of true-color pass-through is your issue (or maybe terminfo
related).
A couple tips:
- I recommend
set -ga terminal-overrides ',xterm-kitty:Tc'
in yourtmux.conf
- I also recommend this in your
vimrc
if &term ==# 'tmux-256color'
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
endif
Best of luck.
you're the best,
working great after adding your suggestion to vimrc and terminal-overrided for tmux
Excellent to hear that.