unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Prompt display in Panther build
@ 2003-10-30 16:17 Matt Tenenbaum
  2003-10-31 12:28 ` Benjamin Riefenstahl
  0 siblings, 1 reply; 5+ messages in thread
From: Matt Tenenbaum @ 2003-10-30 16:17 UTC (permalink / raw)


Yesterday I installed OS X 10.3, which (not surprisingly) broke my 
emacs binary (21.1, I believe, from about a year ago). So yesterday I 
also pulled the latest source from CVS and bootstrapped it into 
existence on the new operating system. Things seem to work 
(functionally) fine with the following possible exception:

When I run 'sql-postgres' to start the interactive SQL mode (to connect 
to a local pgsql server) the behavior differs between the command line 
invocation and the Carbon build. In particular, on the command line, 
everything is (or seems) as it is supposed to be; on the Carbon build, 
there is no prompt. If I enter commands (despite the lack of prompt) 
everything behaves normally (it transforms the text to boldface and 
writes the query results, as usual), but I still don't get any prompt 
showing up.

Initially I thought this might be related to the problems that seem to 
exist with subprocess responses on the terminal, but the problem isn't 
in the terminal nor does it seem to be with the _responses_ to 
commands, so I don't so much think that anymore.

Anybody have any ideas, what might be causing this? Could it be a 
problem with the sql.el in CVS? It is especially strange to me that it 
is different between invocation-types. Any help is greatly appreciated.

Thanks,
-mt

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Prompt display in Panther build
  2003-10-30 16:17 Prompt display in Panther build Matt Tenenbaum
@ 2003-10-31 12:28 ` Benjamin Riefenstahl
  2003-10-31 16:46   ` Andrew Choi
  0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Riefenstahl @ 2003-10-31 12:28 UTC (permalink / raw)
  Cc: emacs-devel

Hi Matt,


Matt Tenenbaum <matt@tty1.org> writes:
> [Mac] OS X 10.3 [...]
>
> When I run 'sql-postgres' to start the interactive SQL mode (to
> connect to a local pgsql server) the behavior differs between the
> command line invocation and the Carbon build. In particular, on the
> command line, everything is (or seems) as it is supposed to be; on
> the Carbon build, there is no prompt. If I enter commands (despite
> the lack of prompt) everything behaves normally (it transforms the
> text to boldface and writes the query results, as usual), but I
> still don't get any prompt showing up.

There are (or at least there used to be) problems with pseudo-ttys
(ptys) on Mac OS X, therefore ptys are disabled for some (all?)
operations.  I think the variable process-connection-type controls
this, so you could try to tweak that.


benny

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Prompt display in Panther build
  2003-10-31 12:28 ` Benjamin Riefenstahl
@ 2003-10-31 16:46   ` Andrew Choi
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Choi @ 2003-10-31 16:46 UTC (permalink / raw)


Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de> writes:

>> When I run 'sql-postgres' to start the interactive SQL mode (to
>> connect to a local pgsql server) the behavior differs between the
>> command line invocation and the Carbon build. In particular, on the
>> command line, everything is (or seems) as it is supposed to be; on
>> the Carbon build, there is no prompt. If I enter commands (despite
>> the lack of prompt) everything behaves normally (it transforms the
>> text to boldface and writes the query results, as usual), but I
>> still don't get any prompt showing up.
>
> There are (or at least there used to be) problems with pseudo-ttys
> (ptys) on Mac OS X, therefore ptys are disabled for some (all?)
> operations.  I think the variable process-connection-type controls
> this, so you could try to tweak that.

I believe the pty problem has been fixed in Panther/Darwin 7.0 (unless
someone can tell me otherwise).

If behavior differs in terminal and GUI mode, perhaps it is useful to
check environment variable settings passed to `psql' that are different
in the two cases (value of process-environment).  Also you may want to
check what arguments are used when psql is called (by stopping at
start-process (?)) in both cases.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Prompt display in Panther build
@ 2003-10-31 18:17 Michael Mauger
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Mauger @ 2003-10-31 18:17 UTC (permalink / raw)


I'm the maintainer of sql.el -- see my comments below...

Matt Tenenbaum wrote --
> When I run 'sql-postgres' to start the interactive SQL mode 
> (to connect to a local pgsql server) the behavior differs 
> between the command line invocation and the Carbon build. 
> In particular, on the command line, everything is (or seems) 
> as it is supposed to be; on the Carbon build, there is no 
> prompt. If I enter commands (despite the lack of prompt) 
> everything behaves normally (it transforms the text to 
> boldface and writes the query results, as usual), but I 
> still don't get any prompt showing up.
> 

First things to check:  
What version of postgres?
What are the prompt strings?
         \echo :PROMPT1
         \echo :PROMPT2
         \echo :PROMPT3

(sql.el is telling comint to expect a prompt of the form "^.*> *")

> Initially I thought this might be related to the problems 
> that seem to exist with subprocess responses on the terminal, 
> but the problem isn't in the terminal nor does it seem to 
> be with the _responses_ to commands, so I don't so much 
> think that anymore.
> 

I've had a similar problem with the command interpreter for SQL Server. 
Is it possible that psql is detecting that it's not connected to a
terminal and thus is skipping the prompt?  Do you get the prompt if you
start up a shell under Emacs and then enter psql?

> Anybody have any ideas, what might be causing this? Could 
> it be a problem with the sql.el in CVS? It is especially 
> strange to me that it is different between invocation-types. 
> Any help is greatly appreciated.
>

Unfortunately, I don't have a postgres config that I can test.  You may
want to also try the mailing list sql.el@gnu.org -- I know that there are
some postgres users on that list.

-- Michael


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Prompt display in Panther build
@ 2003-11-01 21:09 Michael Mauger
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Mauger @ 2003-11-01 21:09 UTC (permalink / raw)


Andrew Choi writes:
>> There are (or at least there used to be) problems with pseudo-ttys
>> (ptys) on Mac OS X, therefore ptys are disabled for some (all?)
>> operations.  I think the variable process-connection-type controls
>> this, so you could try to tweak that.
> 
> I believe the pty problem has been fixed in Panther/Darwin 7.0 (unless
> someone can tell me otherwise).
> 
> If behavior differs in terminal and GUI mode, perhaps it is useful to
> check environment variable settings passed to `psql' that are different
> in the two cases (value of process-environment).  Also you may want to
> check what arguments are used when psql is called (by stopping at
> start-process (?)) in both cases.

I did some further checking on this issue.  The prompt is suppressed in
psql if isatty(fileno(stdin)) or isatty(fileno(stdout)) return false.  If
there are in fact issues with pty support under Mac OS X that would
explain the problem.  

I also did some checking under Windows where there is no native pty
support.  Even though psql is a cygwin app, Emacs isn't, so psql doesn't
detect it's tty state properly (and never will, probably).  

I have submitted a small patch to the Postgres team for the psql
processor to support a command line option that will assume that the
processor is running on a tty even if the environment says it isn't.  If
and when this patch is accepted and released it will be possible to
customize sql-postgres-options to add this new option when psql is
invoked.

-- Michael

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-11-01 21:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-30 16:17 Prompt display in Panther build Matt Tenenbaum
2003-10-31 12:28 ` Benjamin Riefenstahl
2003-10-31 16:46   ` Andrew Choi
  -- strict thread matches above, loose matches on Subject: below --
2003-10-31 18:17 Michael Mauger
2003-11-01 21:09 Michael Mauger

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).