From c3d8665851c20414007f04a481c5a542d9d139f2 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 3 Jan 2023 17:21:42 +0800 Subject: [PATCH] fix(exit): the TUI should not ui_flush() itself (#21625) --- src/nvim/main.c | 4 +++- src/nvim/ui.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/nvim/main.c b/src/nvim/main.c index c20be202e8..b5207f9cf6 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -627,7 +627,9 @@ void os_exit(int r) { exiting = true; - ui_flush(); + if (!ui_client_channel_id) { + ui_flush(); + } ui_call_stop(); ml_close_all(true); // remove all memfiles diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 33c7d0c1fe..4c640693cc 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -506,6 +506,7 @@ handle_T ui_cursor_grid(void) void ui_flush(void) { + assert(!ui_client_channel_id); if (!ui_active()) { return; }