1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

core: add refresh of window title on buffer switch, when option weechat.look.window_title is set

This commit is contained in:
Sébastien Helleu
2025-04-11 19:30:32 +02:00
parent 61ce24cf46
commit d0babe8679
9 changed files with 23 additions and 36 deletions
+1
View File
@@ -4,6 +4,7 @@
### Fixed
- core: add refresh of window title on buffer switch, when option weechat.look.window_title is set
- core: consider all keys are safe in cursor context ([#2244](https://github.com/weechat/weechat/issues/2244))
- irc: display nick changes and quit messages when option irc.look.ignore_tag_messages is enabled ([#2241](https://github.com/weechat/weechat/issues/2241))
- perl: fix build when multiplicity is not available ([#2243](https://github.com/weechat/weechat/issues/2243))
+2 -2
View File
@@ -15532,8 +15532,8 @@ void weechat_window_set_title (const char *title);
Arguments:
* _title_: new title for terminal (NULL to reset title); string is evaluated,
so variables like `${info:version}` can be used
* _title_: new title for terminal; string is evaluated, so variables like
`${info:version}` can be used
(see <<_string_eval_expression,string_eval_expression>>)
C example:
+3 -3
View File
@@ -15873,9 +15873,9 @@ void weechat_window_set_title (const char *title);
Paramètres :
* _title_ : nouveau titre pour le terminal (NULL pour réinitialiser le titre) ;
la chaîne est évaluée, donc les variables comme `${info:version}` peuvent
être utilisées (voir <<_string_eval_expression,string_eval_expression>>)
* _title_ : nouveau titre pour le terminal ; la chaîne est évaluée, donc les variables
comme `${info:version}` peuvent être utilisées
(voir <<_string_eval_expression,string_eval_expression>>)
Exemple en C :
+2 -2
View File
@@ -16302,8 +16302,8 @@ void weechat_window_set_title (const char *title);
Argomenti:
// TRANSLATION MISSING
* _title_: nuovo titolo per il terminale (NULL per resettarlo);
string is evaluated, so variables like `${info:version}` can be used
* _title_: nuovo titolo per il terminale; string is evaluated, so variables
like `${info:version}` can be used
(see <<_string_eval_expression,string_eval_expression>>)
Esempio in C:
+2 -2
View File
@@ -15798,8 +15798,8 @@ void weechat_window_set_title (const char *title);
引数:
* _title_: 端末の新しいタイトル (タイトルをリセットする場合は NULL);
この文字列は評価されるため、文字列内に `${info:version}` などの変数を含めることが可能です
* _title_: 端末の新しいタイトル; この文字列は評価されるため、文字列内に
`${info:version}` などの変数を含めることが可能です
(<<_string_eval_expression,string_eval_expression>> を参照)
C 言語での使用例:
+3 -1
View File
@@ -15100,7 +15100,9 @@ void weechat_window_set_title (const char *title);
Аргументи:
* _title_: нови наслов за терминал (NULL ако желите да ресетујете наслов); стринг се израчунава, тако да је могуће коришћење променљивих као што је `${info:version}` (погледајте <<_string_eval_expression,string_eval_expression>>)
* _title_: нови наслов за терминал; стринг се израчунава, тако да је могуће
коришћење променљивих као што је `${info:version}`
(погледајте <<_string_eval_expression,string_eval_expression>>)
C пример:
+1 -5
View File
@@ -500,12 +500,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));
}
}
/*
+1 -13
View File
@@ -233,12 +233,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 */
@@ -528,13 +523,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 ();
+8 -8
View File
@@ -2481,13 +2481,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));
}
/*
@@ -2575,15 +2573,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);