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+Tgmob12cF+mF9rr-Y3fs+6QYODdwUxtvBhQeZW=RF4upMEzQ@mail.gmail.com
Whole thread Raw
In response to Re: proposal: alternative psql commands quit and exit  (Geoff Winkless <pgsqladmin@geoff.dj>)
Responses Re: proposal: alternative psql commands quit and exit
List pgsql-hackers
On Tue, Jan 16, 2018 at 6:44 AM, Geoff Winkless <pgsqladmin@geoff.dj> wrote:
> A quick PoC.
>
> I should say upfront that I've no axe to grind over this, if no-one
> likes the idea I don't mind: I'm not sure I like it myself (it's quite
> an aggressive stance to take, I think) - I just wanted to see if it
> would work, and provide it as a working possibility.
>
> Basically, I intercept every keypress before we send it to readline.
> If it's 4 (Ctrl-D) we replace the buffer with \q<lf> which then quits,
> even if there's something in the buffer. So simply sending "Ctrl-D to
> quit" would always be true. Everything else just gets passed through
> to readline directly.

This is an impressive attempt to make it possible to write a short and
universally correct help text, but (1) I doubt that we want to
override the user's terminal settings and (2) it won't work on
non-readline builds.

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


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: proposal: alternative psql commands quit and exit
Next
From: Robert Haas
Date:
Subject: Re: let's not complain about harmless patch-apply failures