fix(tui): make :cquit work properly with remote TUI (#25313)

This commit is contained in:
zeertzjq
2023-09-23 11:00:20 +08:00
committed by GitHub
parent c68c121f50
commit c26b39a9aa
3 changed files with 65 additions and 7 deletions

View File

@@ -659,6 +659,9 @@ void os_exit(int r)
if (ui_client_channel_id) {
ui_client_stop();
if (r == 0) {
r = ui_client_exit_status;
}
} else {
ui_flush();
ui_call_stop();

View File

@@ -386,6 +386,9 @@ static void terminfo_stop(TUIData *tui)
unibi_out_ext(tui, tui->unibi_ext.disable_extended_keys);
// May restore old title before exiting alternate screen.
tui_set_title(tui, (String)STRING_INIT);
if (ui_client_exit_status == 0) {
ui_client_exit_status = tui->seen_error_exit;
}
// if nvim exited with nonzero status, without indicated this was an
// intentional exit (like `:1cquit`), it likely was an internal failure.
// Don't clobber the stderr error message in this case.