Re: proposal: alternative psql commands quit and exit - Mailing list pgsql-hackers

From Robert Haas
Subject Re: proposal: alternative psql commands quit and exit
Date
Msg-id CA+TgmobG5Tq1b3L26n06C3w4mhGuJjtf5EZw8xOobeH4kH3M5Q@mail.gmail.com
Whole thread Raw
In response to Re: proposal: alternative psql commands quit and exit  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
On Mon, Jan 15, 2018 at 10:48 AM, Stephen Frost <sfrost@snowman.net> wrote:
> Well, control-C would still work in that case, so I'm not sure that it's
> so bad.  It's certainly better than what we have now.  I would have
> thought to include a hint to use \? for help too but it might make the
> hint too long.  How about putting control-C first, like this?:
>
> Press control-C to abort a command, \q to quit, or \? for help

One problem with this (and to some extent also with my version) is
that it doesn't really make it entirely clear that aborting a command
(or in the case of my version, clearing the input buffer) is something
you really ought to think about doing.  You might see that message and
not quite realize that there is a command in progress; if that weren't
an issue, we wouldn't need to print anything here at all.  It's almost
like we want to say something along the lines of "Hey there,
interactive user!  What you just typed looked suspiciously like a
command but, because there is text in the query buffer, I didn't treat
it as one and printed this ridiculously long blurb instead.  If you
want me to treat it as a command, press ^C to clear the query buffer
and then type that same thing again.  Thanks!"  However, that's a bit
long and, while there are some obvious ways to shorten it somewhat, I
can't really think of an overall phrasing that fits into an
80-character line without losing clarity.

The other point I would make is that, while I agree with you that the
patch is an improvement over the status quo, I'm not really keen to
print a message telling people to use \q or \? when in fact that those
things might not work.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: proposal: alternative psql commands quit and exit
Next
From: Robert Haas
Date:
Subject: Re: proposal: alternative psql commands quit and exit