Hacker News new | ask | show | jobs
by Brian_K_White 751 days ago
There are several different xterms. As in, really different with totally different Fkeys and arrows and colors etc, even while still being largely vt-like, but they all call themself the same TERM=xterm by default.

xterm is not a standard.

1 comments

> There are several different xterms.

Based on my understanding of the situation this claim seems to perhaps be... a little lacking in nuance? :)

In a different context perhaps we'd be talking about "genericization of trademarks" but, at least as a term *cough* referring to a specific software application, well, "the" "xterm" docs[0] think there is "only" "one":

* "xterm (pronounced 'eks-term') is a specific program, not a generic item. It is the standard X terminal emulator program."

Then again, even with a narrow definition of "the standard X terminal emulator program", the xterm moniker can apparently apply to two "implementations"[1], variously[1][2] referred to as "xterm-new" (a.k.a "based on XFree86 xterm" a.k.a. "modern" a.k.a "based on the X11R6.3 xterm, with the addition of ANSI color and VT220 controls") and "xterm-old" (a.k.a "the X11R6 xterm" a.k.a. "xterm-r6").

And, indeed, the docs do use the phrase "other versions of xterm"[3] in reference to:

* other programs "based on xterm's source"

However, it also distinguishes between those programs and programs in two further categories:

* "similar programs not based on xterm's source, which are compatible to different degrees"

* "programs which set TERM to 'xterm', in the hope that applications will treat them the same as xterm" (which apparently includes some whose developers think that by "[...] copying from xterm [source code], they are entitled to do this whether or not the program actually matches xterm's terminal description").

Which segues nicely into...

> they all call themself the same TERM=xterm by default

A habit that the main developer of xterm since 1996 appears to have, um, some additional thoughts about: :D

* https://invisible-island.net/ncurses/ncurses.faq.html#xterm_...

* https://invisible-island.net/xterm/xterm.faq.html#xterm_term...

Hey, maybe we should replace `TERM=` with `USER_AGENT="$TERM (Compatible with xterm)"`, cos that worked out great on the web! :)

Now, some people may respond "No, we should be using feature detection!", to which I might respond, "Hey, yeah, like, we should have a way to find out what features or capabilities the current terminal emulator supports!".

Problem solved!

Guess the only question now is whether we should call it "The Terminal Capabilities System" or "The Terminal Information System"...

...wait, no, those names don't sound... "unixy" enough.

Let's call it "terminfo". Yeah, let's use "terminfo"!

To which I imagine, at least one person might reply, with a sigh, "I wish you would":

* https://invisible-island.net/xterm/terminfo-contents.html#ti...

* https://invisible-island.net/xterm/terminfo-contents.html#ti...

* https://invisible-island.net/xterm/terminfo-contents.html#ti...

* etc

Wait, so, why doesn't this system "work" then? Well, turns out, apparently its "easier" to just tell someone to set `TERM` to a value which might charitably be called "aspirational" and hope it all works out.

(Spoiler: it doesn't[4].)

> xterm is not a standard.

If xterm ain't a standard then why everyone always try to bite its style? :) (Or, whatever the kids say these days...)

So, yes, in one sense, "xterm" is not a standard, it's one specific program, with a specific set of behaviours.

In another sense, well, while some people set out to write a program to emulate a "DEC VT100" terminal behaviour in a compatible manner, other people very much do set out to write a program to emulate "xterm" terminal behaviour in a compatible manner--which suggests the behaviour of "the xterm" is at least a "de facto" standard.

And the problem comes when those developers claim their implementation is so accurate that it is "indistinguishable" from "the real xterm" that `TERM=xterm`, when that's, umm, definitely not the case[5][4].

Heck, even xterm itself isn't so brazen as to set, say, `TERM=vt220`! :)

The good news is that if setting `TERM` to a realistic rather than "aspirational" value is too hard, the author of `xterm` even provides a tool that terminal emulator developers can use to validate & improve some of their compatibility with the "one & only, definitely not a de facto standard, xterm": https://www.invisible-island.net/vttest/

And, personally, I think, all those terminal users out there, when they ask for "xterm" it's not unreasonable for them to expect to get the Real Thing(TM) and not a knock off "we've got xterm at home". :)

But, hey, I probably only first used the xterm in 1994 at the earliest so I could easily be missing some relevant historical nuance. :D

---- faq ----

q: Did this comment really need to be this long?

a: No. But, you know, thanks for reading it. :)

---- footnotes ----

[0] https://invisible-island.net/xterm/xterm.faq.html#what_is_it

[1] https://invisible-island.net/ncurses/ncurses.faq.html#no_xte...

[2] https://invisible-island.net/xterm/xterm.faq.html#forward_hi...

[3] https://invisible-island.net/xterm/xterm.faq.html#other_vers...

[4] https://invisible-island.net/ncurses/ncurses.faq.html#xterm_...

[5] https://invisible-island.net/xterm/xterm.faq.html#compare_ve...

xterm, the term used in error to refer to the definition of a particular terminal, is used by several different implimentations going back decades and spanning many platforms.

Those implimentations not only all assert the exact same "TERM=xterm" by default, many of them even name the executable the same "xterm", yet do not all adhere to any single common standard. The SCO OSR5 xterm is different from old versions of Xfree86 xterm is differrent from the current xorg xterm etc. There is some overlap, but not nearly enough. The differences are not merely small superset/subset feature differences like 256 color support etc. They include, as I did say, totally differrent F-keys and arrows for example.

That is what "xterm is not a standard" means.

It's a word that refers to a range of different definitions that depend on context, not a single specific definition that always means the same thing in any context, and so is not a meaningful definition, or standard.