Skip to content

acquire actual $TERM from terminal instead of hardcoded value #36994

@bam80

Description

@bam80

Component

systemd

Is your feature request related to a problem? Please describe

For serial TTYs sessions $TERM environment variable is currently hardcoded to vt220 value.
This is not the best choice for most of the users (among other inconsistencies, they don't get colors by default).

Describe the solution you'd like

Nowadays, most major terminals support XTGETTCAP (Request Termcap/Terminfo String) feature:

DCS + q Pt ST
Request Termcap/Terminfo String (XTGETTCAP), xterm. The
string following the "q" is a list of names encoded in
hexadecimal (2 digits per character) separated by ; which
correspond to termcap or terminfo key names.
A few special features are also recognized, which are not key
names:

  • Co for termcap colors (or colors for terminfo colors), and
  • TN for termcap name (or name for terminfo name).
  • RGB for the ncurses direct-color extension.
    Only a terminfo name is provided, since termcap
    applications cannot use this information.

That could be used by systemd in the session init to acquire for actual $TERM value used by particular terminal on the other end of the serial TTY.
With fallback to the hardcoded value, as previous.

Continuation of #33707.
@poettering

The systemd version you checked that didn't have the feature you are asking for

systemd 256 (256.7-1.fc41)

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFE 🎁Request for Enhancement, i.e. a feature requestpid1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions