Re: proposal: alternative psql commands quit and exit

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Everaldo Canuto <everaldo(dot)canuto(at)gmail(dot)com>, Chapman Flack <chap(at)anastigmatix(dot)net>, Vik Fearing <vik(dot)fearing(at)2ndquadrant(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: alternative psql commands quit and exit
Date: 2018-01-16 17:20:31
Message-ID: CA+Tgmob12cF+mF9rr-Y3fs+6QYODdwUxtvBhQeZW=RF4upMEzQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 16, 2018 at 6:44 AM, Geoff Winkless <pgsqladmin(at)geoff(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2018-01-16 17:22:35 Re: let's not complain about harmless patch-apply failures
Previous Message Robert Haas 2018-01-16 17:17:50 Re: proposal: alternative psql commands quit and exit