> > The check I was suggesting on whether Ctrl+C has been pressed > on an empty line seems harder to implement, because get_interactive() > just calls readline() or fgets(), which block to return when a whole > line is ready. AFAICS psql can't know what was the edit-in-progress > when these functions are interrupted by a signal instead of > returning normally. > But I don't think this check is essential, it could be left to another > patch. >
Glad I wasn't missing something obvious. I suppose we could base the behavior on whether there's at least one full line already buffered. However, I agree that it can be left to another patch.