mirror of
https://github.com/neovim/neovim.git
synced 2025-10-20 16:51:48 +00:00
fix(tui): wait for embedded server's exit code
Uses the undocumented "error_exit" UI event for a different purpose: When :detach is used on the server, send an "error_exit" with 0 `status` to indicate that the server shouldn't wait for client exit.
This commit is contained in:
@@ -5560,8 +5560,8 @@ static void ex_detach(exarg_T *eap)
|
||||
if (eap && eap->forceit) {
|
||||
emsg("bang (!) not supported yet");
|
||||
} else {
|
||||
// 1. (TODO) Send "detach" UI-event (notification only).
|
||||
// 2. Perform server-side `nvim_ui_detach`.
|
||||
// 1. Send "error_exit" UI-event (notification only).
|
||||
// 2. Perform server-side UI detach.
|
||||
// 3. Close server-side channel without self-exit.
|
||||
|
||||
if (!current_ui) {
|
||||
@@ -5578,7 +5578,7 @@ static void ex_detach(exarg_T *eap)
|
||||
|
||||
// Server-side UI detach. Doesn't close the channel.
|
||||
Error err2 = ERROR_INIT;
|
||||
nvim_ui_detach(chan->id, &err2);
|
||||
remote_ui_disconnect(chan->id, &err2, true);
|
||||
if (ERROR_SET(&err2)) {
|
||||
emsg(err2.msg); // UI disappeared already?
|
||||
api_clear_error(&err2);
|
||||
|
Reference in New Issue
Block a user