mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
treat TERM "tmux" the same as "screen"
To the extent that fish special-cases TERM values relevant to the `screen` program it should do the same for the `tmux` program. Fixes #3512
This commit is contained in:
parent
1155c4b413
commit
83c7931afb
2 changed files with 7 additions and 7 deletions
|
@ -668,20 +668,16 @@ void reader_write_title(const wcstring &cmd, bool reset_cursor_position) {
|
|||
if (term_str.missing()) return;
|
||||
|
||||
const wchar_t *term = term_str.c_str();
|
||||
bool recognized = false;
|
||||
recognized = recognized || contains(term, L"xterm", L"screen", L"nxterm", L"rxvt");
|
||||
bool recognized = contains(term, L"xterm", L"screen", L"tmux", L"nxterm", L"rxvt");
|
||||
recognized = recognized || !wcsncmp(term, L"xterm-", wcslen(L"xterm-"));
|
||||
recognized = recognized || !wcsncmp(term, L"screen-", wcslen(L"screen-"));
|
||||
recognized = recognized || !wcsncmp(term, L"tmux-", wcslen(L"tmux-"));
|
||||
|
||||
if (!recognized) {
|
||||
char *n = ttyname(STDIN_FILENO);
|
||||
|
||||
if (contains(term, L"linux")) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (contains(term, L"linux")) return;
|
||||
if (contains(term, L"dumb")) return;
|
||||
|
||||
if (strstr(n, "tty") || strstr(n, "/vc/")) return;
|
||||
}
|
||||
|
||||
|
|
|
@ -109,10 +109,14 @@ static bool is_screen_name_escape_seq(const wchar_t *code, size_t *resulting_len
|
|||
return false;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// TODO: Decide if this should be removed or modified to also test for TERM values that begin
|
||||
// with "tmux". See issue #3512.
|
||||
const env_var_t term_name = env_get_string(L"TERM");
|
||||
if (term_name.missing() || !string_prefixes_string(L"screen", term_name)) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
const wchar_t *const screen_name_end_sentinel = L"\x1b\\";
|
||||
const wchar_t *screen_name_end = wcsstr(&code[2], screen_name_end_sentinel);
|
||||
|
|
Loading…
Reference in a new issue