feat(tui): builtin UI (TUI) sets client info #30397

Problem:
The default builtin UI client does not declare its client info. This
reduces discoverability and makes it difficult for plugins to identify
the UI.

Solution:
- Call nvim_set_client_info after attaching, as recommended by `:help dev-ui`.
- Also set the "pid" field.
- Also change `ui_active()` to return a count. Not directly relevant to
  this commit, but will be useful later.
This commit is contained in:
Justin M. Keyes
2024-09-18 04:14:06 -07:00
committed by GitHub
parent 22553e1f38
commit ff85e54939
13 changed files with 163 additions and 43 deletions

View File

@@ -351,7 +351,6 @@ int main(int argc, char **argv)
// NORETURN: Start builtin UI client.
if (ui_client_channel_id) {
time_finish();
ui_client_run(remote_ui); // NORETURN
}
assert(!ui_client_channel_id && !use_builtin_ui);
@@ -1514,7 +1513,7 @@ static void init_startuptime(mparm_T *paramp)
}
for (int i = 1; i < paramp->argc - 1; i++) {
if (STRICMP(paramp->argv[i], "--startuptime") == 0) {
time_init(paramp->argv[i + 1], is_embed ? "Embedded" : "Primary/TUI");
time_init(paramp->argv[i + 1], is_embed ? "Embedded" : "Primary (or UI client)");
time_start("--- NVIM STARTING ---");
break;
}