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;