unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Emacs doesn't use only terminfo database to identify a terminal
@ 2022-09-10 10:11 Akib Azmain Turja
  2022-09-10 10:34 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Akib Azmain Turja @ 2022-09-10 10:11 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 862 bytes --]

Emacs uses something more than just a terminfo database to determine the
capabilities of a terminal.  For example, if I run Emacs in St, keys
like C-<left>, M-<up> work.  Then I modified the terminal name by
changing the terminfo source file (st-256color -> est-256color).  If I
run Emacs with the new terminfo database, keys like C-<down>, M-<right>
no longer work, although infocmp shows that both (st-256color and
est-256color) terminfo databases contain identical capabilities.  Now if
I rename the terminal name to something like "st-..." (I used
"st-foo-bar-baz"), those keys work again.

But why?  Who is the culprit here, Emacs or ncurses?

-- 
Akib Azmain Turja

Find me on Mastodon at @akib@hostux.social.

This message is signed by me with my GnuPG key.  Its fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Emacs doesn't use only terminfo database to identify a terminal
  2022-09-10 10:11 Emacs doesn't use only terminfo database to identify a terminal Akib Azmain Turja
@ 2022-09-10 10:34 ` Eli Zaretskii
  2022-09-10 11:27   ` Akib Azmain Turja
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2022-09-10 10:34 UTC (permalink / raw)
  To: Akib Azmain Turja; +Cc: emacs-devel

> From: Akib Azmain Turja <akib@disroot.org>
> Date: Sat, 10 Sep 2022 16:11:51 +0600
> 
> Emacs uses something more than just a terminfo database to determine the
> capabilities of a terminal.  For example, if I run Emacs in St, keys
> like C-<left>, M-<up> work.  Then I modified the terminal name by
> changing the terminfo source file (st-256color -> est-256color).  If I
> run Emacs with the new terminfo database, keys like C-<down>, M-<right>
> no longer work, although infocmp shows that both (st-256color and
> est-256color) terminfo databases contain identical capabilities.  Now if
> I rename the terminal name to something like "st-..." (I used
> "st-foo-bar-baz"), those keys work again.
> 
> But why?  Who is the culprit here, Emacs or ncurses?

See lisp/term/st.el, it's part of the puzzle, I think.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Emacs doesn't use only terminfo database to identify a terminal
  2022-09-10 10:34 ` Eli Zaretskii
@ 2022-09-10 11:27   ` Akib Azmain Turja
  0 siblings, 0 replies; 3+ messages in thread
From: Akib Azmain Turja @ 2022-09-10 11:27 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1819 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Akib Azmain Turja <akib@disroot.org>
>> Date: Sat, 10 Sep 2022 16:11:51 +0600
>> 
>> Emacs uses something more than just a terminfo database to determine the
>> capabilities of a terminal.  For example, if I run Emacs in St, keys
>> like C-<left>, M-<up> work.  Then I modified the terminal name by
>> changing the terminfo source file (st-256color -> est-256color).  If I
>> run Emacs with the new terminfo database, keys like C-<down>, M-<right>
>> no longer work, although infocmp shows that both (st-256color and
>> est-256color) terminfo databases contain identical capabilities.  Now if
>> I rename the terminal name to something like "st-..." (I used
>> "st-foo-bar-baz"), those keys work again.
>> 
>> But why?  Who is the culprit here, Emacs or ncurses?
>
> See lisp/term/st.el, it's part of the puzzle, I think.
>

Yeah, it is.  Putting the following in my early-init.el make those
C-<up> keys work:

--8<---------------cut here---------------start------------->8---
(setq term-file-aliases
      '(("apollo" . "vt100")
        ("vt102" . "vt100")
        ("vt125" . "vt100")
        ("vt201" . "vt200")
        ("vt220" . "vt200")
        ("vt240" . "vt200")
        ("vt300" . "vt200")
        ("vt320" . "vt200")
        ("vt400" . "vt200")
        ("vt420" . "vt200")
        ("alacritty" . "xterm")
        ("est" . "st")
        ("foot" . "xterm")))
--8<---------------cut here---------------end--------------->8---

Thanks, I just found that those keys are defined in xterm-function-map
in lisp/term/xterm.el.

-- 
Akib Azmain Turja

Find me on Mastodon at @akib@hostux.social.

This message is signed by me with my GnuPG key.  Its fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-10 11:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-10 10:11 Emacs doesn't use only terminfo database to identify a terminal Akib Azmain Turja
2022-09-10 10:34 ` Eli Zaretskii
2022-09-10 11:27   ` Akib Azmain Turja

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).