diff --git a/src/reader.cpp b/src/reader.cpp index 00ffe9231..f3886668a 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -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; } diff --git a/src/screen.cpp b/src/screen.cpp index 8095f1a8f..54a1203f3 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -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);