diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-01-01 23:18:19 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-01 23:18:19 +0800 |
commit | c590641febf4d03e89c46f8e7ef4c3fb2a455520 (patch) | |
tree | 348e7c132c6ee3e8fdd2886340a9ce468b36ca3a | |
parent | f60cff8f9a253cac5c67199cd00bb9ecd15c5558 (diff) | |
download | rneovim-c590641febf4d03e89c46f8e7ef4c3fb2a455520.tar.gz rneovim-c590641febf4d03e89c46f8e7ef4c3fb2a455520.tar.bz2 rneovim-c590641febf4d03e89c46f8e7ef4c3fb2a455520.zip |
fix(tui): do not set ui_client_termname if it is already set (#21607)
It is fine to initialize ui_client_termname to NULL as it is only used
after tui_start().
-rw-r--r-- | src/nvim/tui/tui.c | 5 | ||||
-rw-r--r-- | src/nvim/ui_client.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 984f96354a..0d01cd44cd 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -310,11 +310,12 @@ static void terminfo_start(UI *ui) #endif // Set up unibilium/terminfo. - ui_client_termname = NULL; if (term) { data->ut = unibi_from_term(term); if (data->ut) { - ui_client_termname = xstrdup(term); + if (!ui_client_termname) { + ui_client_termname = xstrdup(term); + } if (!data->term) { data->term = xstrdup(term); } diff --git a/src/nvim/ui_client.h b/src/nvim/ui_client.h index 0b1f1ecb29..67d16e7fb1 100644 --- a/src/nvim/ui_client.h +++ b/src/nvim/ui_client.h @@ -34,7 +34,7 @@ EXTERN TriState ui_client_bg_respose INIT(= kNone); /// by convention, this uses fd=3 (next free number after stdio) EXTERN bool ui_client_forward_stdin INIT(= false); -EXTERN char *ui_client_termname INIT(= "null"); +EXTERN char *ui_client_termname INIT(= NULL); #define UI_CLIENT_STDIN_FD 3 #ifdef INCLUDE_GENERATED_DECLARATIONS |