Re: psql: backslash fix - Mailing list pgsql-patches

From Peter Eisentraut
Subject Re: psql: backslash fix
Date
Msg-id Pine.LNX.4.30.0203111916070.690-100000@peter.localdomain
Whole thread Raw
In response to Re: psql: backslash fix  (Neil Conway <nconway@klamath.dyndns.org>)
List pgsql-patches
Neil Conway writes:

> > 3. Ignore the failed backslash command and keep going.  This is what it's
> >    doing.
>
> Even if we want to continue with this behavior, I think the current
> implementation is confusing: psql should recall the previous buffer, set
> the prompt to "=>", and allow the user to continue editing the command.
> For example:
>
> nconway=> select foo\\bar;
> Invalid command \. Try \? for help.
> nconway=> select foo
>       ^^^^^^^^^^ recalled by psql, the user can continue
>              typing after this point

That's an interesting idea.  I'm sure readline can do this, but I haven't
looked.

> > Think of psql as an editor and (some of) the backslash commands as editor
> > commands.  When you enter a wrong command in your editor, what does it do?
>
> It gives me an error. For instance, in vim:
>
> ":set nooooexpandtab" -> "Unknown option: nooooexpandtab"
>
> And it returns me to my previous mode. It does _not_ recall ":set ..."

Yes, but note that it doesn't completely clear the editing area or save
the file or compile it.


--
Peter Eisentraut   peter_e@gmx.net


pgsql-patches by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Domain Support -- another round
Next
From: Peter Eisentraut
Date:
Subject: Re: support for POSIX 1003.1-2001 hosts