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 0227a3ca1c3ec08b3546c8c52a7f579b9919a766

Pass $TERM value into get_title_kind() as a param
Author: xaizek
Author date (UTC): 2019-07-25 16:47
Committer name: xaizek
Committer date (UTC): 2019-07-25 16:47
Parent(s): 4d12e9a224e786757b24a4a7b339cd508f5e8ef6
Signing key: 99DC5E4DB05F6BE2
Tree: fd50cd01e1bcee9f21f0efe3cdbe5fefd91dd59a
File Lines added Lines deleted
src/int/term_title.c 3 5
File src/int/term_title.c changed (mode: 100644) (index 8869257dc..bf0850926)
... ... typedef enum
52 52 TitleKind; TitleKind;
53 53
54 54 static void ensure_initialized(void); static void ensure_initialized(void);
55 static TitleKind get_title_kind(void);
55 static TitleKind get_title_kind(const char term[]);
56 56 static void save_term_title(void); static void save_term_title(void);
57 57 static void restore_term_title(void); static void restore_term_title(void);
58 58 #if !defined(_WIN32) && defined(HAVE_X11) #if !defined(_WIN32) && defined(HAVE_X11)
 
... ... ensure_initialized(void)
150 150 return; return;
151 151 } }
152 152
153 title_state.kind = get_title_kind();
153 title_state.kind = get_title_kind(env_get("TERM"));
154 154 if(title_state.kind == TK_REGULAR) if(title_state.kind == TK_REGULAR)
155 155 { {
156 156 save_term_title(); save_term_title();
 
... ... ensure_initialized(void)
161 161 /* Checks if we can alter terminal emulator title. Returns kind of writes we /* Checks if we can alter terminal emulator title. Returns kind of writes we
162 162 * should do. */ * should do. */
163 163 static TitleKind static TitleKind
164 get_title_kind(void)
164 get_title_kind(const char term[])
165 165 { {
166 166 #ifdef _WIN32 #ifdef _WIN32
167 167 return TK_REGULAR; return TK_REGULAR;
 
... ... get_title_kind(void)
177 177 "screen", "screen-bce", "screen-256color", "screen-256color-bce" "screen", "screen-bce", "screen-256color", "screen-256color-bce"
178 178 }; };
179 179
180 const char *const term = env_get("TERM");
181
182 180 if(is_in_string_array(XTERM_LIKE, ARRAY_LEN(XTERM_LIKE), term)) if(is_in_string_array(XTERM_LIKE, ARRAY_LEN(XTERM_LIKE), term))
183 181 { {
184 182 return TK_REGULAR; return TK_REGULAR;
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