Doom emacs do not render correctly the color on ssh terminal

What happened?

This is a problem that I was never able to solve and I always try to switch on another editor when I am coding on my remote machine.

However, I think that I solution should be somewhere for this kind of problem and that I am the only one that is finding this problem.

MY doom configuration with emacs 29.1 on my host machine

but the same configuration on the same file in a ssh session shows the following error

What did you expect to happen?

I think the two configurations should be shown the same. I also try to use export TERM='xterm-256color' or export TERM='xterm' but this do not work for me.

I was also thinking of using trump but this is not working very well for me.

System information

➜  ~ neofetch
          ▗▄▄▄       ▗▄▄▄▄    ▄▄▄▖            vincenzopalazzo@nixos
          ▜███▙       ▜███▙  ▟███▛            ---------------------
           ▜███▙       ▜███▙▟███▛             OS: NixOS 23.05.3759.261abe8a44a7 (Stoat) x86_64
            ▜███▙       ▜██████▛              Host: ASRock H97M Pro4
     ▟█████████████████▙ ▜████▛     ▟▙        Kernel: 6.5.5
    ▟███████████████████▙ ▜███▙    ▟██▙       Uptime: 17 mins
           ▄▄▄▄▖           ▜███▙  ▟███▛       Packages: 1048 (nix-system), 521 (nix-user)
          ▟███▛             ▜██▛ ▟███▛        Shell: zsh 5.9
         ▟███▛               ▜▛ ▟███▛         Terminal: /dev/pts/0
▟███████████▛                  ▟██████████▙   CPU: Intel i7-4790 (8) @ 4.000GHz
▜██████████▛                  ▟███████████▛   GPU: NVIDIA GeForce GTX 970
      ▟███▛ ▟▙               ▟███▛            Memory: 1135MiB / 15939MiB
     ▟███▛ ▟██▙             ▟███▛
    ▟███▛  ▜███▙           ▝▀▀▀▀
    ▜██▛    ▜███▙ ▜██████████████████▛
     ▜▛     ▟████▙ ▜████████████████▛
           ▟██████▙       ▜███▙
          ▟███▛▜███▙       ▜███▙
         ▟███▛  ▜███▙       ▜███▙
         ▝▀▀▀    ▀▀▀▀▘       ▀▀▀▘

➜  ~

I discussed the problem on the emacs mailing list [1]

The problem was that my theme assumes 24-bit color, and your remote machine is not advertising that capability. So I followed the emacs docs

and run the following commands solve my problem

$ cat terminfo-custom.src

xterm-emacs|xterm with 24-bit direct color mode for Emacs,
  use=xterm-256color,
  setb24=\E[48\:2\:\:%p1%{65536}%/%d\:%p1%{256}%/%{255}%&\
     %d\:%p1%{255}%&%dm,
  setf24=\E[38\:2\:\:%p1%{65536}%/%d\:%p1%{256}%/%{255}%&\
     %d\:%p1%{255}%&%dm,

$ tic -x -o ~/.terminfo terminfo-custom.src

[1] Do not render correctly colors on ssh terminal

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.