Add "alacritty" to the list of TERM values of terminals supporting dynamic titles#7073
Merged
Merged
Add "alacritty" to the list of TERM values of terminals supporting dynamic titles#7073
Conversation
This change is necessary to fix dynamic titles for the Alacritty terminal. We do this by simply adding the (wchar_t *) literal L"alacritty" to the end of the title_terms array. This variable is ultimately used in the subsequent function does_term_support_setting_title (dtsst) for the purposes of whitelisting certain terminals. If an Alacritty user does not have the terminfo for alacritty present in their terminfo database, Alacritty sets the TERM variable to "xterm-256color", but if the terminfo for Alacritty is present, TERM is instead set to "alacritty". Prior to this change, none of the "fallback patterns" in the dtsst function (which is used to ultimately decide whether or not a given value of the TERM environment variable is supported) would apply to a value of "alacritty". Ordinarily, the dtsst function would return true if nothing matches, but one of the final checks involves testing the result of ttyname_r to see if it contains the substring "tty", which causes dtsst to return false. In the case where TERM="alacritty", this is erroneous, because Alacritty does, indeed, support changing its title and will also silently ignore attempts to change the title if that behavior has been disabled by the user [1]. The changed file, src/env_dispatch.cpp, was reformatted by clang-format in accordance with the documented procedures for contributors. Signed-off-by: Kristofer Rye <kristofer.rye@gmail.com> [1]: https://github.com/alacritty/alacritty/blob/1dacc99183373bffa3ba287aa3241f3b1da67016/alacritty_terminal/src/term/mod.rs#L896-L900
Contributor
Author
|
I'm not sure if this PR warrants an addition to |
Member
|
Thank you! |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
This change fixes support for "dynamic titles" for users of the Alacritty terminal. Users with the terminfo for
alacrittyinstalled in their terminfo database would have theirTERMvalues set toalacrittyby default (as opposed toxterm-256color), which would break fish-shell's understanding.Prior to this change, the
does_term_support_setting_titlefunction would returnfalsebecause the term valuealacrittymatches the patterntty(causing this line to returnfalse). Other values ofTERMnot including the substringsttyor/vc/and not matching any of the prior patterns would instead be interpreted as having support for dynamic titles, but in this case because the stringalacrittycontains "tty", it would get interpreted as not having support for dynamic titles.I'd be happy to make any additional changes requested!
TODOs: