diff --git a/src/gmnlm.c b/src/gmnlm.c
index ee25e3fc2343f6aeaf0ab7eeeafed40808f0e526..f1a856cd58092ba29c9e766370f790b1240970f2 100644
--- a/src/gmnlm.c
+++ b/src/gmnlm.c
@@ -622,6 +622,7 @@ char *in = NULL;
size_t l = 0;
ssize_t n = getline(&in, &l, browser->tty);
if (n == -1 && feof(browser->tty)) {
+ fputc('\n', browser->tty);
result = PROMPT_QUIT;
goto exit;
}