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

From Geoff Winkless
Subject Re: proposal: alternative psql commands quit and exit
Date
Msg-id CAEzk6feWvBc8qAw=3pPTdQ5AwkW0DynbE95fzk+s9py3bvWoNA@mail.gmail.com
Whole thread Raw
In response to Re: proposal: alternative psql commands quit and exit  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: proposal: alternative psql commands quit and exit
List pgsql-hackers
On 15 January 2018 at 17:03, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Geoff Winkless <pgsqladmin@geoff.dj> writes:
>> And while trying to find the EOF setting in libreadline might get
>> messy, you're already assuming that ctrl-C hasn't been knobbled using
>> stty intr. Unless you want to go searching for that too?
>
> Yeah, that's why I personally don't want to mention ctrl-C in this
> message.  If we do mention it we're going to need to look up what
> the signal is really bound to.

Could always rewrite gets_interactive to implement the documented
"alternative interface" to readline

https://tiswww.cwru.edu/php/chet/readline/readline.html#SEC43

and force exit that way by intercepting Ctrl-D at the character level.
That does feel a bit (!) wrong though, and I'm not sure how difficult
it gets with different locales etc. Would also have to modify
gets_fromFile, in case readline was disabled.

At this point it depends quite how far down the rabbit-hole you want
to go to stop people googling "how do I exit psql", I suppose :p

Geoff


pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: [HACKERS] proposal: psql command \graw
Next
From: Pavel Stehule
Date:
Subject: polymorphic parameters limits - correct solution?