Re: proposal: alternative psql commands quit and exit

From: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>
To: David Fetter <david(at)fetter(dot)org>
Cc: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Robert Haas <robertmhaas(at)gmail(dot)com>, 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-15 17:04:18
Message-ID: CAEzk6feQ3nbHU0NozLrQ8Bx0ooQE-yd54LB4zUpexChtv6MMNA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 15 January 2018 at 16:56, David Fetter <david(at)fetter(dot)org> wrote:
> On Mon, Jan 15, 2018 at 04:53:27PM +0000, Geoff Winkless wrote:
>> 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?
>
> I'm pretty sure changing either or both of those settings would
> qualify as pilot error, and pretty abstruse pilot error at that.

Oh I agree. I was merely pointing out that the likelihood of one is no
more than the other.

In fact, I _have_ worked on systems (in the 90s, admittedly) where
intr was mapped to the "Delete" key. I've never (to my knowledge)
worked on a system where EOF was mapped to anything other than CTRL-D
in a command-line context, although I can see that emacs obsessives
might want to have configured their readline that way, which would
stomp all over ctrl-D.

It also occurs to me that if someone has just typed quit<cr> or
exit<cr> space at the start-of-line should not be a problem for
Ctrl-D, because the buffer is empty.

I still think it (Ctrl-D on *nix, Ctrl-C on windows) is the best of a
bad bunch, to be honest.

Geoff

On 15 January 2018 at 16:56, David Fetter <david(at)fetter(dot)org> wrote:
> On Mon, Jan 15, 2018 at 04:53:27PM +0000, Geoff Winkless wrote:
>> On 15 January 2018 at 16:48, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> > Geoff Winkless <pgsqladmin(at)geoff(dot)dj> writes:
>> >> Perhaps different messages on different OSes? :)
>> >
>> > It's worse than that: the EOF key is configurable. In principle
>> > we could look into the tty settings and print the right thing, but
>> > I doubt we want to go there, especially if there's no
>> > corresponding thing on Windows.
>>
>> But surely if Windows always exits using Ctrl-C than that's easiest?
>>
>> 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?
>
> I'm pretty sure changing either or both of those settings would
> qualify as pilot error, and pretty abstruse pilot error at that.
>
> Best,
> David.
> --
> David Fetter <david(at)fetter(dot)org> http://fetter.org/
> Phone: +1 415 235 3778
>
> Remember to vote!
> Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2018-01-15 17:12:26 Re: [HACKERS] Early locking option to parallel backup
Previous Message Tom Lane 2018-01-15 17:03:25 Re: proposal: alternative psql commands quit and exit