public inbox for cygwin-xfree@sourceware.org
help / color / mirror / Atom feed
* no interaction in xterm, but it works in a cygwin shell
@ 2004-02-17 18:48 Andreas Seidl
  2004-02-18  4:19 ` Igor Pechtchanski
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Seidl @ 2004-02-17 18:48 UTC (permalink / raw)
  To: cygwin-xfree


I'm using a Lisp-based computer algebra system called REDUCE. Basically 
it is started by a call of the form:

#!/usr/bin/bash -v
/cygdrive/c/devred/lisp/psl/win32/psl/bpsl -td 16000000 -f 
'C:\devred\lisp\psl\win32\red\reduce.img'

The -v option is for printing the executed commands on the screen. The 
second line calls the Lisp (bpsl.exe) with the memory size (16Mb) and an 
image file (reduce.img). The binary bpsl.exe was compiled under Windows.

In a Cygwin shell, i can have an interactive session without problems, e.g.:

----- start -----
seidl@Bellarmin /cygdrive/d
$ reduce
#!/usr/bin/bash -v
# Run Windows PSL REDUCE.
/cygdrive/c/devred/lisp/psl/win32/psl/bpsl -td 16000000 -f 
'C:\devred\lisp\psl\w
in32\red\reduce.img'
Loading image file :C:\devred\lisp\psl\win32\red\reduce.img

REDUCE Development Version, 10-Dec-03 ...

1: factorial 40;

815915283247897734345611269596115894272000000000

2: factorial 50;

30414093201713378043612608166064768844377641568960512000000000000

3: quit;

Quitting

seidl@Bellarmin /cygdrive/d
$
------ end -----

Now, if I do the same in an xterm, the following happens: There is no 
output on the screen from REDUCE. But I can enter line by line:

factorial 40;
factorial 50;
quit;

As soon as the quit; is entered, all the missing output is flushed to 
the screen, see this screenshot of an xterm session:

----- start -----
seidl@Bellarmin ~
$ reduce
#!/usr/bin/bash -v
# Run Windows PSL REDUCE.
/cygdrive/c/devred/lisp/psl/win32/psl/bpsl -td 16000000 -f 
'C:\devred\lisp\psl\w
in32\red\reduce.img'
factorial 40;
factorial 50;
quit;
Loading image file :C:\devred\lisp\psl\win32\red\reduce.img

REDUCE Development Version, 10-Dec-03 ...

1:
815915283247897734345611269596115894272000000000

2:
30414093201713378043612608166064768844377641568960512000000000000

3:
Quitting

seidl@Bellarmin ~
$
----- end -----

So my question is: Can somebody explain this behaviour, is there a 
solution? (E.g. the command line version of Maple works nicely both in 
xterm and a Cygwin shell.)

Ciao,
Andreas.
--
http://www.fmi.uni-passau.de/~seidl



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

* Re: no interaction in xterm, but it works in a cygwin shell
  2004-02-17 18:48 no interaction in xterm, but it works in a cygwin shell Andreas Seidl
@ 2004-02-18  4:19 ` Igor Pechtchanski
  0 siblings, 0 replies; 2+ messages in thread
From: Igor Pechtchanski @ 2004-02-18  4:19 UTC (permalink / raw)
  To: cygwin-xfree

On Tue, 17 Feb 2004, Andreas Seidl wrote:

> I'm using a Lisp-based computer algebra system called REDUCE. Basically
> it is started by a call of the form:
>
> #!/usr/bin/bash -v
> /cygdrive/c/devred/lisp/psl/win32/psl/bpsl -td 16000000 -f
> 'C:\devred\lisp\psl\win32\red\reduce.img'
>
> The -v option is for printing the executed commands on the screen. The
> second line calls the Lisp (bpsl.exe) with the memory size (16Mb) and an
> image file (reduce.img). The binary bpsl.exe was compiled under Windows.
>
> In a Cygwin shell, i can have an interactive session without problems, e.g.:
>
> ----- start -----
> seidl@Bellarmin /cygdrive/d
> $ reduce
> #!/usr/bin/bash -v
> # Run Windows PSL REDUCE.
> /cygdrive/c/devred/lisp/psl/win32/psl/bpsl -td 16000000 -f
> 'C:\devred\lisp\psl\w
> in32\red\reduce.img'
> Loading image file :C:\devred\lisp\psl\win32\red\reduce.img
>
> REDUCE Development Version, 10-Dec-03 ...
>
> 1: factorial 40;
>
> 815915283247897734345611269596115894272000000000
>
> 2: factorial 50;
>
> 30414093201713378043612608166064768844377641568960512000000000000
>
> 3: quit;
>
> Quitting
>
> seidl@Bellarmin /cygdrive/d
> $
> ------ end -----
>
> Now, if I do the same in an xterm, the following happens: There is no
> output on the screen from REDUCE. But I can enter line by line:
>
> factorial 40;
> factorial 50;
> quit;
>
> As soon as the quit; is entered, all the missing output is flushed to
> the screen, see this screenshot of an xterm session:
>
> ----- start -----
> seidl@Bellarmin ~
> $ reduce
> #!/usr/bin/bash -v
> # Run Windows PSL REDUCE.
> /cygdrive/c/devred/lisp/psl/win32/psl/bpsl -td 16000000 -f 'C:\devred\lisp\psl\win32\red\reduce.img'
> factorial 40;
> factorial 50;
> quit;
> Loading image file :C:\devred\lisp\psl\win32\red\reduce.img
>
> REDUCE Development Version, 10-Dec-03 ...
>
> 1:
> 815915283247897734345611269596115894272000000000
>
> 2:
> 30414093201713378043612608166064768844377641568960512000000000000
>
> 3:
> Quitting
>
> seidl@Bellarmin ~
> $
> ----- end -----
>
> So my question is: Can somebody explain this behaviour, is there a
> solution? (E.g. the command line version of Maple works nicely both in
> xterm and a Cygwin shell.)
>
> Ciao,
> Andreas.

Andreas,

Just a WAG, but could it be that lisp detects that it's running on a
console and uses a different (interactive) input mode?  As far as Windows
programs are concerned, a pty is nothing but a pipe, so you may have to
force interactive mode somehow (via a flag?).

Or it could be a CRLF vs. LF issue (i.e., the program waiting for CRLF to
complete the line, but getting LFs, and then, once it gets the EOF,
parsing the whole input), but I doubt it.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton


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

end of thread, other threads:[~2004-02-17 18:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-17 18:48 no interaction in xterm, but it works in a cygwin shell Andreas Seidl
2004-02-18  4:19 ` Igor Pechtchanski

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).