mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 09:12:11 +08:00
Add "alacritty" to the list of known titleable TERMs
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]: 1dacc99183/alacritty_terminal/src/term/mod.rs (L896-L900)
This commit is contained in:
parent
4d487f711d
commit
146ec619d9
@ -417,7 +417,8 @@ static bool initialize_curses_using_fallback(const char *term) {
|
||||
/// One situation in which this breaks down is with screen, since screen supports setting the
|
||||
/// terminal title if the underlying terminal does so, but will print garbage on terminals that
|
||||
/// don't. Since we can't see the underlying terminal below screen there is no way to fix this.
|
||||
static const wchar_t *const title_terms[] = {L"xterm", L"screen", L"tmux", L"nxterm", L"rxvt"};
|
||||
static const wchar_t *const title_terms[] = {L"xterm", L"screen", L"tmux",
|
||||
L"nxterm", L"rxvt", L"alacritty"};
|
||||
static bool does_term_support_setting_title(const environment_t &vars) {
|
||||
const auto term_var = vars.get(L"TERM");
|
||||
if (term_var.missing_or_empty()) return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user