Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 565648 - RFC: Smarter code for terminal title
Summary: RFC: Smarter code for terminal title
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-13 08:33 UTC by Abbaad
Modified: 2023-05-26 13:45 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Terminal title code enhancement (terminal-title.patch,3.11 KB, patch)
2015-11-13 08:33 UTC, Abbaad
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Abbaad 2015-11-13 08:33:16 UTC
Created attachment 416820 [details, diff]
Terminal title code enhancement

Currently, the code to set the title or status line of the terminal has
hard-coded escape sequences and a regexp to match $TERM [1]. This is a problem
if you happen to be using a terminal which either isn't on the list (e.g.,
#497902) or has a different way of setting the title/status line.

Rather than occasionally adding terms to this regexp as terminals come into
and out of fashion, it would be helpful to have a smarter, more robust
solution.

There is a semi-standard terminfo method to set the title/status line: tsl and
fsl. Although these appear in the terminfo database for a few notable
terminals (e.g., rxvt-unicode, xterm+sl, st, screen-256color-s), they *do not*
appear in the more common TERMs such as xterm.

Despite this, it would be easier to implement functionality respecting this
pseudo-standard and point to it any time someone comes in complaining that
their new-fangled terminal doesn't get status updates. That is, shift the
burden of maintenance to the users. There are a few who are already advocating
for appending to terminfo entries [2].

Of course, we wouldn't want to break the existing functionality, so the regexp
could still be a fallback, just with the understanding that it's there for
historical reasons. This is what is implemented in the above patch.

[1] https://gitweb.gentoo.org/proj/portage.git/tree/pym/portage/output.py#n237
[2] https://gist.github.com/KevinGoodsell/744284#file-terminals-txt-L106