I have a bunch of dotfiles that allow me to have a pretty theme on my terminal and tmux on my local host. I use kitty, fish and tmux. To properly define colors and have a global coherence, I use the following files :
I also have a remote server, which runs the same arch + fish + tmux and uses exactly the same dotfiles. However, when SSH-ing into the server, everything looks completely different :
I have google around and there are a lot of tutorials that tell you to add a bunch of weird configs, but none actually explain what is really happening under the hood (also, as you can see, none of them worked).
Here is what I tried to do to make it work (without really understanding why) :
- Added to tmux.conf :
set^[[3m -g default-terminal "xterm-kitty" set-option^[[3m -ga terminal-overrides ",xterm-kitty*:Tc"
- Added the xterm-kitty terminfo file
- Change the
TERMenv variable to xterm-kitty on login
I would love for some resources to point to how this all works! Thanks!
For clarity, here are the values of
TERM I have :
- On local host :
- On local host inside tmux :
- On remote host directly after opening ssh :
- On remote host in tmux :
All files are synced using a git repo, all versions are identical. I have transfered the same
terminfo file related to
xterm-kitty on both hosts. Also, using this script, I can see that all colors are properly displayed and identical on both hosts.
I also noticed that logging into the remote machine without tmux yields yet another combination of colors (same fish config file used everywhere) :