Thinking
Highlighting key distinctions The request involves examining Unix terminal capabilities for xterm-256color and xterm-ghostty. A side-by-side ASCII table will compare color and line features, emphasizing specific differences.
Noticing key differences I’m examining xterm-256color and xterm-ghostty. xterm-256color supports 65536 color pairs and lacks advanced features. xterm-ghostty, specialized, includes extended sequences and unique capabilities.
Analyzing terminal sequences I'm working through the terminal sequences of xterm-256color and xterm-ghostty, noting differences such as color pairs, clipboard support, and advanced capabilities like status lines and full keyboard support.
Presenting the differences It's interesting to see that xterm-256color and xterm-ghostty differ in boolean, number, and string capabilities. Creating a concise table to highlight these distinctions can clarify their unique features.
Spotting differences I’m noting distinctions in boolean, number, and string capabilities between xterm-256color and xterm-ghostty, including features like status lines and full keyboard support. Thought about Unix terminal capabilities for 47 seconds
Below is a casual but detailed look at some notable differences between xterm-256color and xterm-ghostty in their terminfo entries. We'll present the key differences in ASCII tables so you can visually compare which capabilities differ.
These are the simple on/off (true/false) flags. Below we list only those that differ (i.e., present in one but missing in the other, or vice versa).
+--------------+----------------------+--------------------+
| Capability | xterm-256color | xterm-ghostty |
+--------------+----------------------+--------------------+
| OTbs | True | (Not listed) |
| hs | (Not listed) | True |
| Su | (Not listed) | True |
| Tc | (Not listed) | True |
| fullkbd | (Not listed) | True |
+--------------+----------------------+--------------------+
Key points:
- OTbs appears in xterm-256color but not in xterm-ghostty.
- hs (has status line), Su, Tc, and fullkbd appear in xterm-ghostty but not in xterm-256color.
hs
means the terminal supports a status line (or similar “host status” area).Su
andTc
are extra extended capabilities sometimes used for advanced color manipulations.fullkbd
indicates (in some terminfo definitions) that the terminal supports a "full keyboard" set of key definitions beyond some minimal set.
Here we look at differences in numeric values (such as number of colors, lines, or color pairs).
+----------------+----------------------+--------------------+
| Capability | xterm-256color | xterm-ghostty |
+----------------+----------------------+--------------------+
| colors | 256 | 256 |
| pairs | 65536 (0x10000) | 32767 |
+----------------+----------------------+--------------------+
Key points:
- Both report
colors=256
, so both terminals can produce 256 color indices. - Color pairs differ:
- xterm-256color supports 65536 pairs (
pairs#0x10000
), - xterm-ghostty supports 32767 pairs.
This difference can matter in applications that use many distinct foreground/background combinations simultaneously.
- xterm-256color supports 65536 pairs (
Both definitions have very large strings for key bindings, cursor controls, etc. Below are a few specific examples where they diverge:
+--------------------+------------------------------------+-------------------------------------+
| Capability | xterm-256color | xterm-ghostty |
+--------------------+------------------------------------+-------------------------------------+
| acsc | ``aaffggiijj... | ++\,\,--..00``aaffgghh... |
| rs1 | \Ec\E]104\007 | \E]\E\\\Ec |
| cr | \r (Carriage Return) | ^M (also Carriage Return) |
| dsl (status line) | (Not listed) | \E]2;\007 |
| smcup (enter alt.) | \E[?1049h\E[22;0;0t | \E[?1049h |
| rmcup (exit alt.) | \E[?1049l\E[23;0;0t | \E[?1049l |
+--------------------+------------------------------------+-------------------------------------+
A few highlights:
-
acsc
(Alternate Character Set):- xterm-256color:
acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~
- xterm-ghostty:
acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~
They share many mappings but differ in certain punctuation/line-drawing definitions.
- xterm-256color:
-
rs1
(Reset-string #1):- xterm-256color:
\Ec\E]104\007
- xterm-ghostty:
\E]\E\\\Ec
Both aim to reset terminal state but use different sequences.
- xterm-256color:
-
dsl
(Disable status line):- Not listed for xterm-256color, but xterm-ghostty sets this to
\E]2;\007
. - Ties in with the
hs
(has status line) capability in xterm-ghostty.
- Not listed for xterm-256color, but xterm-ghostty sets this to
-
smcup
/rmcup
(Enter/Exit Alternate Screen):- Slight differences in parameters:
- xterm-256color: also tries
\E[22;0;0t
to resize or modify the window state. - xterm-ghostty: a shorter sequence
\E[?1049h
/\E[?1049l
.
- xterm-256color: also tries
- Slight differences in parameters:
- xterm-ghostty appears to be a specialized or extended xterm variant that:
- Declares itself capable of status line support (
hs
). - Uses additional extended capabilities (
Su
,Tc
,fullkbd
). - Has slightly different reset and alternate screen sequences.
- Has fewer total color pairs (32767 instead of 65536).
- Declares itself capable of status line support (
- xterm-256color is the classic definition for a 256-color xterm:
- More widely used in mainstream distributions.
- Lacks the
hs
and certain “extended” features found in xterm-ghostty. - Uses a more standard set of reset/initialization sequences.
Both xterm-256color and xterm-ghostty are very similar overall—both support 256 colors, many key sequences, and the usual xterm-style control codes. The biggest functional differences are that xterm-ghostty advertises status line support (hs
) and some extended capabilities (Su
, Tc
, fullkbd
), whereas xterm-256color has a slightly larger color-pair count and sticks to more typical xterm reset strings.
If you’re just learning terminfo, the main takeaway is that these differences reflect how terminal emulators (or custom definitions) might add or tweak certain features—status lines, advanced color sequences, reset behaviors, etc.—all while remaining largely compatible with standard xterm usage.