xaizek / vifm (License: GPLv2+) (since 2018-12-07)
Vifm is a file manager with curses interface, which provides Vi[m]-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Commit 8e68938ad3836e924dcadc0b1b6a817b232690a4

Correct handling of tmux by 'title'
Previous attempt was in commit a43e2e36f1667c2cecc4b547953fd1204238bb01:

Made 'title' work for $TERM used by tmux

Thanks to fugue.

See
https://q2a.vifm.info/227/how-to-stop-vifm-from-overwriting-screen-title?show=2470#c2470

That checked for tmux on a path that doesn't execute with "tmux" or
"tmux-*" $TERM value.
Author: xaizek
Author date (UTC): 2026-07-16 08:37
Committer name: xaizek
Committer date (UTC): 2026-07-16 08:37
Parent(s): 4f9a658ca0fdff831173851b98c8d841bf1df9ff
Signing key: 99DC5E4DB05F6BE2
Tree: 031acd1904d7e5f38caf7b70c86e2dbc1f069832
File Lines added Lines deleted
ChangeLog 2 2
src/int/term_title.c 16 4
File ChangeLog changed (mode: 100644) (index 6ce96b425..684fd76cf)
129 129 Improved wording of documentation sections describing filters and Improved wording of documentation sections describing filters and
130 130 patterns. patterns.
131 131
132 Made 'title' work when $TERM equals "tmux" or starts with "tmux-". Thanks
133 to fugue.
132 Made 'title' set title of a tmux window when $TERM equals "tmux" or starts
133 with "tmux-". Thanks to fugue.
134 134
135 135 Fixed 'trashdir' with "%r" on BSD-like systems (those with getmntinfo() Fixed 'trashdir' with "%r" on BSD-like systems (those with getmntinfo()
136 136 instead of getmntent() API). The regression was apparently introduced in instead of getmntent() API). The regression was apparently introduced in
File src/int/term_title.c changed (mode: 100644) (index 5bb177219..6e27450c3)
... ... ensure_initialized(void)
179 179 return; return;
180 180 } }
181 181
182 title_state.kind = query_title_kind();
182 const char *term = env_get_def("TERM", "");
183 if(strcmp(term, "tmux") == 0 || starts_with_lit(term, "tmux-"))
184 {
185 /* tmux defines "tsl" and "fsl" in its terminfo entry, but they do not set
186 * title of a tmux window or terminal's title. Escape sequences used by
187 * GNU Screen set title of tmux window and need to be set here before
188 * query_title_kind() to have an effect. */
189 title_state.kind = TK_SCREEN;
190 apply_term_guess(title_state.kind);
191 }
192 if(title_state.kind == TK_ABSENT)
193 {
194 title_state.kind = query_title_kind();
195 }
183 196 if(title_state.kind == TK_ABSENT) if(title_state.kind == TK_ABSENT)
184 197 { {
185 title_state.kind = title_kind_for_termenv(env_get_def("TERM", ""));
198 title_state.kind = title_kind_for_termenv(term);
186 199 apply_term_guess(title_state.kind); apply_term_guess(title_state.kind);
187 200 } }
188 201
 
... ... title_kind_for_termenv(const char term[])
260 273 return TK_REGULAR; return TK_REGULAR;
261 274 } }
262 275
263 if(strcmp(term, "screen") == 0 || starts_with_lit(term, "screen-") ||
264 strcmp(term, "tmux") == 0 || starts_with_lit(term, "tmux-"))
276 if(strcmp(term, "screen") == 0 || starts_with_lit(term, "screen-"))
265 277 { {
266 278 return TK_SCREEN; return TK_SCREEN;
267 279 } }
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vifm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vifm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master