Subject: Re: bug#45824: 27.1; term/screen.el not loaded when TERM=screen.xterm-256color

From: Eli Zaretskii <[email-masked]>
Date: Tue, 19 Jan 2021 21:20:15 +0200

> From: Alex Hutcheson <[email-masked]>
> Date: Tue, 19 Jan 2021 13:33:09 -0500
> Cc: Lars Ingebrigtsen <[email-masked]>, [email-masked]
> 
> A defcustom won't really work, since the correct value of TERM to use
> might be different for different frames. For example, I might
> sometimes launch Emacs directly within an xterm, and other times
> launch it within a screen session.

A defcustom can be set (by your code) depending on the value of TERM,
of course, so this problem is easily solvable.  IOW, my proposal is to
delegate the responsibility for "parsing" the TERM value to the user
initializations, instead of asking Emacs to understand all the
possible quirks there.

> Also, we already have the term-file-aliases variable, which enables a
> workaround as mentioned up the thread.

Then perhaps nothing at all needs to be done.  (I thought that the
existing aliases were somehow inconvenient in this case.)

> However, I still think we should aim to work correctly with GNU Screen
> without any additional configuration required by the user. The current
> state is broken in that regard.

I just don't see where that would end, that's all.  Any
terminal emulator can call itself anything, and Emacs cannot possibly
know all the future names.

But that's me; if Lars thinks we should have built-in support for this
use case, I won't argue.  I was just responding to his request for
other opinions.