fix(tui): don't process UI events when suspending or stopping (#33710)

When the TUI is suspending or stopping, redraw events should not be
processed, as when it next processes redraw events it's already waiting
for a DA1 response after having disabled some terminal modes.

Fix #33708
This commit is contained in:
zeertzjq
2025-04-29 17:37:54 +08:00
committed by GitHub
parent ffb93d9883
commit c35dde03c8
2 changed files with 2 additions and 2 deletions

View File

@ -247,8 +247,7 @@ static void parse_msgpack(Channel *channel)
Unpacker *p = channel->rpc.unpacker; Unpacker *p = channel->rpc.unpacker;
while (unpacker_advance(p)) { while (unpacker_advance(p)) {
if (p->type == kMessageTypeRedrawEvent) { if (p->type == kMessageTypeRedrawEvent) {
// When exiting, ui_client_stop() has already been called, so don't handle UI events. if (ui_client_attached) {
if (ui_client_channel_id && !exiting) {
if (p->has_grid_line_event) { if (p->has_grid_line_event) {
ui_client_event_raw_line(&p->grid_line_event); ui_client_event_raw_line(&p->grid_line_event);
p->has_grid_line_event = false; p->has_grid_line_event = false;

View File

@ -186,6 +186,7 @@ void ui_client_run(bool remote_ui)
void ui_client_stop(void) void ui_client_stop(void)
{ {
ui_client_attached = false;
if (!tui_is_stopped(tui)) { if (!tui_is_stopped(tui)) {
tui_stop(tui); tui_stop(tui);
} }