From 5b34c2ab73d62431f391d454e68a84332148d609 Mon Sep 17 00:00:00 2001 From: glacambre Date: Tue, 25 Jan 2022 07:59:17 +0100 Subject: fix(--headless): do not block on press-enter prompts when no UI This commit fixes #9358, where emitting multiple messages with 'echo' or a single one with 'echom' or 'echoerr' would result in a press-enter prompt that couldn't be dismissed by pressing enter. This requires adapting a few tests to spawn a UI before testing whether press-enter prompts are blocking. It also fixes #11718, as when combined with #15910 it enables making sure that neovim never blocks and emits messages on startup. --- src/nvim/message.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/nvim/message.c b/src/nvim/message.c index d963cba6cb..93742ccbdb 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1094,6 +1094,10 @@ void wait_return(int redraw) return; } + if (headless_mode && !ui_active()) { + return; + } + /* * When inside vgetc(), we can't wait for a typed character at all. * With the global command (and some others) we only need one return at -- cgit