(OP here) Sadly, the previous 'fix' caused a crash when `.exit` is given interactively instead of being read from a file (either redirected or by `.read` command). An improved possibility is probably this: ``` --- src/shell.c.in +++ src/shell.c.in @@ -7845,11 +7845,12 @@ rc = 1; } }else if( c=='e' && strncmp(azArg[0], "exit", n)==0 ){ + if( !stdin_is_interactive && p->in==stdin ) + while (fgetc(p->in) != EOF); if( nArg>1 && (rc = (int)integerValue(azArg[1]))!=0 ) exit(rc); rc = 2; }else ``` ... always pending review from eager SQLite3 insiders ...