Skip to content

Commit a02dc40

Browse files
committed
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.
1 parent acf5e3e commit a02dc40

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/nvim/main.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,14 @@ int main(int argc, char **argv)
513513
// Execute any "+", "-c" and "-S" arguments.
514514
if (params.n_commands > 0) {
515515
exe_commands(&params);
516+
// If in headless mode, we need to exit at this point.
517+
// If we continue, we will enter the normal mode and the
518+
// message "Press ENTER or type command to continue" will be
519+
// displayed and we will be in the input waiting state.
520+
if (headless_mode) {
521+
msg_putchar('\n');
522+
return 0;
523+
}
516524
}
517525

518526
starting = 0;

0 commit comments

Comments
 (0)