help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do not render correctly colors on ssh terminal


From: Vincenzo Palazzo
Subject: Re: Do not render correctly colors on ssh terminal
Date: Tue, 10 Oct 2023 19:23:50 +0200

>
>
> > I have 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 [1] configuration with emacs 29.1 on my host machine is rendered
> > in the terminal as [2] but the same configuration on the same file in a
> > ssh session emacs is rendered as [3].
>
> The thread devolved into getting you to use Tramp, but the answer to
> your original problem is somewhere in terminal capability definitions.
>
> On your local machine, you probably have TERM=xterm-256color or
> similar in your environment and you have a terminfo database entry for
> that terminal. Typing ‘infocmp’ probably says ‘colors#0x100’ or
> ‘colors#256’ somewhere near the top.
>

Ok running on my host machine

➜  ~ infocmp
# Reconstructed via infocmp from file: /usr/share/terminfo/a/alacritty
alacritty|alacritty terminal emulator,
am, bce, ccc, hs, mc5i, mir, msgr, npc, xenl,
colors#0x100, cols#80, it#8, lines#24, pairs#0x10000,
acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,

colors#0x100 should be colors#256


> On your remote machine, you should still have TERM=xterm-256color, as
> ‘ssh’ forwards that variable by default. However, if the corresponding
> terminfo database entry is not installed, applications will not detect
> that your terminal is capable of displaying 256 colors. ‘infocmp’ will
> say colors#8 or something similar.
>

On my remote machine

➜  ~ infocmp
# Reconstructed via infocmp from file:
/etc/profiles/per-user/vincenzopalazzo/share/terminfo/a/alacritty
alacritty|alacritty terminal emulator,
am, bce, ccc, hs, km, mc5i, mir, msgr, npc, xenl,
colors#0x100, cols#80, it#8, lines#24, pairs#0x7fff,
acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
clear=\E[H\E[2J, cnorm=\E[?12l\E[?25h, cr=\r,
csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,

This should be the same right?


>
> How you install the required terminfo entries will depend on your
> distribution. On Debian-based distros,
> ‘/usr/share/terminfo/x/xterm-256color’ is installed by the package
> ‘ncurses-base’.
>
> There is also a possibility that your theme assumes 24-bit color, and
> your remote machine is not advertising that capability. See
>
> https://www.gnu.org/software/emacs/manual/html_node/efaq/Colors-on-a-TTY.html
> for a summary where Emacs looks before it decides whether 24-bit color
> is or is not available.
>

$ 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


$ TERM=xterm-emacs emacs -nw

This fix the problem, thanks!

P.S: I will start a new thread now to fix the tramp problem!

Cheers,

Vincent.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]