Re: [HACKERS] Proposal: psql force prompting on notty - Mailing list pgsql-patches

From Michael Mauger
Subject Re: [HACKERS] Proposal: psql force prompting on notty
Date
Msg-id 20031111015840.59438.qmail@web60307.mail.yahoo.com
Whole thread Raw
In response to Re: [HACKERS] Proposal: psql force prompting on notty  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
You can send it to me to test.  I've duplicated the reported behavior
here so I can test the fix.  (Ideally, send me a url to downloaded it
from rather than attaching it.)

Just a thought, a corresponding option of --batch/-B could be added to do
the opposite of the --interactive/-I option.  Having options to override
dynamically detected configuration is not all that uncommon.

Thanks.

-- Michael

PS. Beware of the first patch I sent -- it had a bug in the string sent
to getopt.  It had an option "M" rather than "I".  The second patch was
corrected.

--- Bruce Momjian <pgman@candle.pha.pa.us> wrote:
>
> This is an unusual one.  The OS isn't handling things properly, and we
> have to work around that.  Can you get a Win32 user to test psql with
> this patch to make sure it actually fixes the problem and behaves as
> expected?  If you want me to produce a psql binary, I can do that.
>
> Thanks.
>
>
---------------------------------------------------------------------------
>
> Michael Mauger wrote:
> > I'm the maintainer of sql.el in GNU Emacs.  On both the Mac OS X
> > and the Windows/Cygwin platform we've had reports that psql run
> > under Emacs does not issue a prompt for commands.
> >
> > I did a little research and it appears that the cause is that
> > pset.notty is being set to false because stdin/stdout are not
> > a tty (pgsql-server/src/bin/psql/startup.c).  I'd like to
> > propose that an option be added to the psql command line to
> > override the detection of the tty and force the prompting for
> > commands on stdin.
> >
> > I believe the attached patch should add the option -I to psql
> > and force the prompt to appear as if it were an interactive
> > session regardless of the state of stdin/stdout.  I do not
> > have a configuration available to properly test this however.
> >
> > Please be sure to include me in any replies since I do not
> > subscribe to this list.  TIA.
> >



__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

pgsql-patches by date:

Previous
From: Manfred Spraul
Date:
Subject: Re: SIGPIPE handling, take two.
Next
From: Tom Lane
Date:
Subject: Re: SIGPIPE handling, take two.