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 :
- .Xresoures
- kitty.conf
- fish_prompt.fish
- .tmux.conf
On my local host, everything looks really clean :
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
TERM
env variable to xterm-kitty on login
I would love for some resources to point to how this all works! Thanks!
Edit :
For clarity, here are the values of TERM
I have :
- On local host :
xterm-kitty
- On local host inside tmux :
xterm-256color
- On remote host directly after opening ssh :
xterm-kitty
- On remote host in tmux :
xterm-256color
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) :
xterm-kitty
terminfo file you have installed. Is it also different if you use another terminal like xterm or gnome-terminal? Are you sure there is no default fish config that is interfering? – Nicholas Marriott Apr 10 '20 at 13:04xterm-kitty
in vanilla terminfo. The correct rendered-upon terminal type is, assuming that this is KiTTY rather than kitty, probablyputty-256color
. – JdeBP Apr 10 '20 at 14:33