all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
To: Yuri Khan <yuri.v.khan@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Do not render correctly colors on ssh terminal
Date: Tue, 10 Oct 2023 19:23:50 +0200	[thread overview]
Message-ID: <CAKy8djTJ6iijk90tzTpZKixSsucFyR6jnn4dq0hrrtMGjz5ojg@mail.gmail.com> (raw)
In-Reply-To: <CAP_d_8Xjqx9ws0Vu8ksorqTexKXpdOGYO3mYQZ8g+eqFcSEBGw@mail.gmail.com>

>
>
> > 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	other threads:[~2023-10-10 17:23 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-05 19:07 Do not render correctly colors on ssh terminal Vincenzo Palazzo
2023-10-05 22:11 ` Emanuel Berg
2023-10-06 21:07   ` Vincenzo Palazzo
2023-10-07 11:29 ` Michael Albinus
     [not found]   ` <CAKy8djQF5zQts75xdNpGaWY5rzpMjkzaqqLf+HAM6OUFr9K_EQ@mail.gmail.com>
     [not found]     ` <8734ymochn.fsf@gmx.de>
     [not found]       ` <CAKy8djRH93g=ydi=PvZ5FmHQp=CJkviDENE0YY+Fqx3B99L=nw@mail.gmail.com>
     [not found]         ` <87jzryijen.fsf@gmx.de>
2023-10-07 14:49           ` Vincenzo Palazzo
2023-10-07 15:42             ` Michael Albinus
2023-10-07 16:38               ` Vincenzo Palazzo
2023-10-07 16:46                 ` Michael Albinus
2023-10-07 17:10                   ` Vincenzo Palazzo
2023-10-07 17:13                     ` Michael Albinus
     [not found]                       ` <CAKy8djQaA=Qcgr7vTt9H3SnPCi2vGkMmzaRPgse0CjsQP_mhVA@mail.gmail.com>
2023-10-08  7:29                         ` Michael Albinus
2023-10-08 18:15                           ` Vincenzo Palazzo
2023-10-08 19:24                             ` Michael Albinus
2023-10-09  7:53                               ` Vincenzo Palazzo
2023-10-09  7:58                               ` Vincenzo Palazzo
2023-10-09  8:18                                 ` Michael Albinus
     [not found]                                   ` <CAKy8djS35rVJQSC8vNFaderSP-mSuxqT7ScC9d9sbkK3QRVAzg@mail.gmail.com>
2023-10-09  9:24                                     ` Michael Albinus
2023-10-09 14:30                                       ` Vincenzo Palazzo
2023-10-09 14:42                                         ` Emanuel Berg
2023-10-10  9:13                                           ` Vincenzo Palazzo
2023-10-09 16:12                                         ` Michael Albinus
2023-10-09 16:16                                           ` Yuri Khan
2023-10-09 16:22                                             ` Michael Albinus
2023-10-09 16:39 ` Yuri Khan
2023-10-10 17:23   ` Vincenzo Palazzo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKy8djTJ6iijk90tzTpZKixSsucFyR6jnn4dq0hrrtMGjz5ojg@mail.gmail.com \
    --to=vincenzopalazzodev@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=yuri.v.khan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.