mirror of
https://github.com/weechat/weechat.git
synced 2026-07-08 10:43:13 +02:00
core: add refresh of window title on buffer switch, when option weechat.look.window_title is set
This commit is contained in:
@@ -498,12 +498,8 @@ config_change_window_title (const void *pointer, void *data,
|
||||
(void) data;
|
||||
(void) option;
|
||||
|
||||
if (gui_init_ok
|
||||
|| (CONFIG_STRING(config_look_window_title)
|
||||
&& CONFIG_STRING(config_look_window_title)[0]))
|
||||
{
|
||||
if (gui_init_ok)
|
||||
gui_window_set_title (CONFIG_STRING(config_look_window_title));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -231,12 +231,7 @@ gui_main_init (void)
|
||||
gui_term_cols, gui_term_lines, 100, 100))
|
||||
{
|
||||
gui_current_window = gui_windows;
|
||||
|
||||
if (CONFIG_STRING(config_look_window_title)
|
||||
&& CONFIG_STRING(config_look_window_title)[0])
|
||||
{
|
||||
gui_window_set_title (CONFIG_STRING(config_look_window_title));
|
||||
}
|
||||
gui_window_set_title (CONFIG_STRING(config_look_window_title));
|
||||
}
|
||||
|
||||
/* switch to buffer */
|
||||
@@ -526,13 +521,6 @@ gui_main_end (int clean_exit)
|
||||
/* delete global history */
|
||||
gui_history_global_free ();
|
||||
|
||||
/* reset title */
|
||||
if (CONFIG_STRING(config_look_window_title)
|
||||
&& CONFIG_STRING(config_look_window_title)[0])
|
||||
{
|
||||
gui_window_set_title (NULL);
|
||||
}
|
||||
|
||||
/* end color */
|
||||
gui_color_end ();
|
||||
|
||||
|
||||
@@ -2479,13 +2479,11 @@ gui_window_refresh_screen (int full_refresh)
|
||||
refresh ();
|
||||
gui_window_read_terminal_size ();
|
||||
refresh ();
|
||||
gui_window_set_title (
|
||||
(CONFIG_STRING(config_look_window_title)
|
||||
&& CONFIG_STRING(config_look_window_title)[0]) ?
|
||||
CONFIG_STRING(config_look_window_title) : NULL);
|
||||
}
|
||||
|
||||
gui_window_refresh_windows ();
|
||||
|
||||
gui_window_set_title (CONFIG_STRING(config_look_window_title));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2573,15 +2571,17 @@ gui_window_set_title (const char *title)
|
||||
{
|
||||
char *new_title, *envterm, *envshell, *shell, *shellname;
|
||||
|
||||
envterm = getenv ("TERM");
|
||||
if (!envterm)
|
||||
if (!title || !title[0])
|
||||
return;
|
||||
|
||||
new_title = (title && title[0]) ?
|
||||
eval_expression (title, NULL, NULL, NULL) : NULL;
|
||||
new_title = eval_expression (title, NULL, NULL, NULL);
|
||||
if (!new_title)
|
||||
return;
|
||||
|
||||
envterm = getenv ("TERM");
|
||||
if (!envterm)
|
||||
return;
|
||||
|
||||
if (strcmp (envterm, "sun-cmd") == 0)
|
||||
{
|
||||
printf ("\033]l%s\033\\", new_title);
|
||||
|
||||
Reference in New Issue
Block a user