From a02dc40e3b3fad69cedcde6abe1bd4efe39ab102 Mon Sep 17 00:00:00 2001 From: Kei Kamikawa Date: Thu, 30 Apr 2020 21:41:23 +0900 Subject: [PATCH] fixed "Press ENTER or type command to continue" to be suppressed If in headless mode, we need to exit at this point. If we continue, we will enter the normal mode and the message "Press ENTER or type command to continue" will be displayed and we will be in the input waiting state. --- src/nvim/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/nvim/main.c b/src/nvim/main.c index 4a9f2371a2..90221f6ce2 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -513,6 +513,14 @@ int main(int argc, char **argv) // Execute any "+", "-c" and "-S" arguments. if (params.n_commands > 0) { exe_commands(¶ms); + // If in headless mode, we need to exit at this point. + // If we continue, we will enter the normal mode and the + // message "Press ENTER or type command to continue" will be + // displayed and we will be in the input waiting state. + if (headless_mode) { + msg_putchar('\n'); + return 0; + } } starting = 0;