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 9b9add0bc8ff890107e26deeef45823c076a3f33

Extend list of terminals that support title
Thanks to Matthias Braun (a.k.a. mb720).

Fixes #457 on GitHub.
Author: xaizek
Author date (UTC): 2019-07-25 17:02
Committer name: xaizek
Committer date (UTC): 2019-07-25 17:02
Parent(s): fef4f82bd5c2e905d1fd443d9225e5089ac20a16
Signing key: 99DC5E4DB05F6BE2
Tree: aa9ff129e9ce0f7551d186ab7553afb3720b1fed
File Lines added Lines deleted
ChangeLog 4 0
src/int/term_title.c 5 14
tests/misc/integration.c 5 3
File ChangeLog changed (mode: 100644) (index 0145b8e13..ef6c06e58)
9 9 Made udisks2 part of vifm-media script compatible with python3. Patch by Made udisks2 part of vifm-media script compatible with python3. Patch by
10 10 zsugabubus. zsugabubus.
11 11
12 Assume that any $TERM value that starts with "xterm-", "rxvt-" or
13 "screen-" supports terminal title. Thanks to Matthias
14 Braun (a.k.a. mb720).
15
12 16 Fixed assertion failure on resetting 'classify' option when 'millerview' Fixed assertion failure on resetting 'classify' option when 'millerview'
13 17 is on (reproducing it is harder than that, but that's the idea). Patch by is on (reproducing it is harder than that, but that's the idea). Patch by
14 18 zsugabubus. zsugabubus.
File src/int/term_title.c changed (mode: 100644) (index a33f5342a..2e19af265)
35 35 #include <stddef.h> /* NULL size_t */ #include <stddef.h> /* NULL size_t */
36 36 #include <stdio.h> /* stdout fflush() */ #include <stdio.h> /* stdout fflush() */
37 37 #include <stdlib.h> /* atol() free() */ #include <stdlib.h> /* atol() free() */
38 #include <string.h> /* strcmp() */
38 39
39 40 #include "../utils/env.h" #include "../utils/env.h"
40 41 #include "../utils/macros.h" #include "../utils/macros.h"
41 42 #include "../utils/str.h" #include "../utils/str.h"
42 #include "../utils/string_array.h"
43 43 #include "../utils/test_helpers.h" #include "../utils/test_helpers.h"
44 44 #include "../utils/utf8.h" #include "../utils/utf8.h"
45 45
 
... ... get_title_kind(const char term[])
167 167 #ifdef _WIN32 #ifdef _WIN32
168 168 return TK_REGULAR; return TK_REGULAR;
169 169 #else #else
170 /* These have "char *" because of is_in_string_array() prototype. */
171
172 static char *XTERM_LIKE[] = {
173 "xterm", "xterm-256color", "rxvt", "rxvt-256color", "rxvt-unicode",
174 "aterm", "Eterm",
175 };
176
177 static char *SCREEN_LIKE[] = {
178 "screen", "screen-bce", "screen-256color", "screen-256color-bce"
179 };
180
181 if(is_in_string_array(XTERM_LIKE, ARRAY_LEN(XTERM_LIKE), term))
170 if(strcmp(term, "xterm") == 0 || starts_with_lit(term, "xterm-") ||
171 strcmp(term, "rxvt") == 0 || starts_with_lit(term, "rxvt-") ||
172 strcmp(term, "aterm") == 0 || strcmp(term, "Eterm") == 0)
182 173 { {
183 174 return TK_REGULAR; return TK_REGULAR;
184 175 } }
185 176
186 if(is_in_string_array(SCREEN_LIKE, ARRAY_LEN(SCREEN_LIKE), term))
177 if(strcmp(term, "screen") == 0 || starts_with_lit(term, "screen-"))
187 178 { {
188 179 return TK_SCREEN; return TK_SCREEN;
189 180 } }
File tests/misc/integration.c changed (mode: 100644) (index 4a88c4313..cc3fe9c27)
... ... TEST(externally_edited_local_filter_is_applied, IF(not_windows))
259 259 TEST(title_support_is_detected_correctly) TEST(title_support_is_detected_correctly)
260 260 { {
261 261 static char *XTERM_LIKE[] = { static char *XTERM_LIKE[] = {
262 "xterm", "xterm-256color", "rxvt", "rxvt-256color", "rxvt-unicode",
263 "aterm", "Eterm",
262 "xterm", "xterm-256color", "xterm-termite", "xterm-anything",
263 "rxvt", "rxvt-256color", "rxvt-unicode", "rxvt-anything",
264 "aterm", "Eterm"
264 265 }; };
265 266
266 267 static char *SCREEN_LIKE[] = { static char *SCREEN_LIKE[] = {
267 "screen", "screen-bce", "screen-256color", "screen-256color-bce"
268 "screen", "screen-bce", "screen-256color", "screen-256color-bce",
269 "screen-anything"
268 270 }; };
269 271
270 272 #ifdef _WIN32 #ifdef _WIN32
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