output.py: support title setting via curses/terminfo#1343
Open
gerstner-hub wants to merge 3 commits intogentoo:masterfrom
Open
output.py: support title setting via curses/terminfo#1343gerstner-hub wants to merge 3 commits intogentoo:masterfrom
gerstner-hub wants to merge 3 commits intogentoo:masterfrom
Conversation
Currently only the list of hard coded terminal names found in _legal_terms_re allow usage of the title setting feature. Maintaining this list is a burden and means that some terminals will miss out this feature, although they actually do have support for it. Thus, try to use the curses module to dynamically query the terminfo database for "tsl" (to status line) and "fsl" (from status line) strings. This way all terminals that declare support for the feature will automatically benefit. As a fallback, should curses not be available, still rely on the _legal_terms_re for setting up terminal titles. Signed-off-by: Matthias Gerstner <matthias.gerstner@nefkom.net>
The global variables are inconsistently named and spread over the module, similarly the title related code is not grouped together. Harmonize this. Also the double negative logic involving `_disable_xtermTitle` makes the code harder to read. Invert the logic. Signed-off-by: Matthias Gerstner <matthias.gerstner@nefkom.net>
zmedico
reviewed
Jun 17, 2024
sys.stderr is sometimes temporarily replaced by other objects, thus rely on sys.__stdserr__ consistently. Also provide a default for `fd` in `init_curses()`.
Member
Author
Oh, I thought this had already been merged. No wonder it never appeared in production ... No these commits are unrelated to this topic here. With this PR# the special purpose code for a few specific terminals is replaced by calls to ncurses, this way all terminals that provide proper terminfo files will be transparently supported by portage. |
Member
|
Thanks, I'll seek advice from someone well-versed in these affairs and let you know. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To support terminal title setting for a broader range of terminals, implement curses/terminfo support for setting terminal titles, instead of relying only on the hard coded list of supported $TERM values.