mirror of
https://github.com/postgres/postgres.git
synced 2025-12-21 05:21:08 +03:00
Allow psql's other uses of simple_prompt() to be interrupted by ^C.
This fills in the work left un-done by 5f1148224. \prompt can
be canceled out of now, and so can password prompts issued during
\connect. (We don't need to do anything for password prompts
issued during startup, because we aren't yet trapping SIGINT
at that point.)
Nathan Bossart
Discussion: https://postgr.es/m/747443.1635536754@sss.pgh.pa.us
This commit is contained in:
@@ -164,6 +164,12 @@ simple_prompt_extended(const char *prompt, bool echo,
|
||||
fflush(termout);
|
||||
#endif
|
||||
}
|
||||
else if (prompt_ctx && prompt_ctx->canceled)
|
||||
{
|
||||
/* also echo \n if prompt was canceled */
|
||||
fputs("\n", termout);
|
||||
fflush(termout);
|
||||
}
|
||||
|
||||
if (termin != stdin)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user