david moss wrote:
> Hi,
>
> Does anyone know how poplog determines whether its running in
> interactive mode?
>
> I ask because I'm working on a java wrapper for the interpreter that
> will hopefully will be turned into a JEdit (www.jedit.org) plugin at
> some stage. I am able to get a bash shell into a JTextArea, and from
> there invoke pop11, but the interpreter exits on mishaps instead of just
> pointing them out as it does in ved... If anyone has any idea of what
> I'm talking about could you please help?
>
> david.
>
To explain a bit better, here is the output I get from running pop11:
From XTerm:
==================================================================
[dsm@destruktor:~]$ pop11
Sussex Poplog (Version 15.53 Wed Apr 16 13:11:34 GMT 2003)
Copyright (c) 1982-1999 University of Sussex. All rights reserved.
Setpop
: define some();
: [some test]=>
: enddefine;
:
: some();
** [some test]
: bye();
[dsm@destruktor:~]$
==================================================================
and when a mishap is thrown:
==================================================================
[dsm@destruktor:~]$ pop11
Sussex Poplog (Version 15.53 Wed Apr 16 13:11:34 GMT 2003)
Copyright (c) 1982-1999 University of Sussex. All rights reserved.
Setpop
: x+1;
;;; DECLARING VARIABLE x
;;; MISHAP - NUMBER(S) NEEDED
;;; INVOLVING: <undef x> 1
;;; DOING : + pop_setpop_compiler
Setpop
: bye();
[dsm@destruktor:~]$
==================================================================
Now from my java terminal:
==================================================================
bash: no job control in this shell
[dsm@destruktor:~/work/java/poplog/Jedit Console]$ pop11
define some();
[some test]=>
enddefine;
some();
** [some test]
bye([dsm@destruktor:~/work/java/poplog/Jedit Console]$
==================================================================
And when a mishap is thrown:
==================================================================
[dsm@destruktor:~/work/java/poplog/Jedit Console]$ pop11
x + ;;; DECLARING VARIABLE x
1;
;;; MISHAP - NUMBER(S) NEEDED
;;; INVOLVING: <undef x> 1
;;; DOING : + pop_setpop_compiler
[dsm@destruktor:~/work/java/poplog/Jedit Console]$
==================================================================
Note that the bye() command was only interpreted up to the openning
bracket in the java terminal, also there is no prompt sent to stderr
unlike the xterm.
The command I'm sending to start bash in the JTextArea is "/bin/bash
--login --noediting -i" which gives me the prompt according to my $PS1
variable, but starting /any/ interpreter (js/another
bash/perl/python/poplog anything) is done in a non-interactive way.
I'm wondering whether any of them use the isatty() function call to
determine where they are running and more importantly if there is a way
to cheat poplog into thinking its running in interactive mode to emulate
the behaviour of the XTerm.
regards,
Dave.
PS, Sorry I couldn't send this immediately after the previous message,
I'm on a 56k modem and sometimes (for no known reason) the telephone
line just dies... an engineer is comming to look at it sometime soon.
--
=================================================
The future of HTML mail is clearly > /dev/null.
=================================================
Two of the most famous products of Berkeley are
LSD and Unix. I don t think that is a coincidence
=================================================
|