feat(ui): UI :detach command

Problem:
Cannot detach the current UI.

Solution:
- Introduce `:detach`.
- Introduce `Channel.detach`.

Co-authored-by: bfredl <bjorn.linse@gmail.com>
This commit is contained in:
Justin M. Keyes
2025-02-09 22:04:33 +01:00
parent ad60b3fb48
commit 4b0e2605ea
20 changed files with 244 additions and 63 deletions

View File

@@ -61,9 +61,14 @@ uint64_t ui_client_start_server(int argc, char **argv)
CallbackReader on_err = CALLBACK_READER_INIT;
on_err.fwd_err = true;
#ifdef MSWIN
bool detach = false; // TODO(justinmk): detach=true breaks `tt.setup_child_nvim` tests on Windows.
#else
bool detach = true;
#endif
Channel *channel = channel_job_start(args, get_vim_var_str(VV_PROGPATH),
CALLBACK_READER_INIT, on_err, CALLBACK_NONE,
false, true, true, false, kChannelStdinPipe,
false, true, true, detach, kChannelStdinPipe,
NULL, 0, 0, NULL, &exit_status);
if (!channel) {
return 0;