On Tue, 16 Mar 1999, philippe boyer wrote:
This is a known problem with the NT version of JDK 1.2. This is
a JDK bug and there is nothing Jacl can do to fix it. If you
have found a workaround I would like to see it, but I am a little
confused about the change you made to Shell.java. Could you try this
simple echo program out and tell me what changes you would make to
it to fix the problem under JDK 1.2.
public class echo {
public static void main(String[] argv) throws Exception {
System.out.println("Please begin typing, type quit to stop");
while (true) {
int avail = System.in.available();
if (avail < 0) {
throw new Exception("System.in.available() returned " + avail);
} else if (avail == 0) {
Thread.currentThread().sleep(100);
} else {
byte[] buff = new byte[avail];
System.in.read(buff);
// quit if they typed "quit"
if ((buff.length == 5 || buff.length == 6) &&
buff[0] == 'q' && buff[1] == 'u' &&
buff[2] == 'i' && buff[3] == 't') {System.exit(0);}
// echo back what was just typed
System.out.println("-----ECHO BEGIN-----");
System.out.write(buff);
System.out.println("-----ECHO END-----");
System.out.println();
}
}
}
}
thanks
Mo DeJong
dejong at cs.umn.edu
> hi,
> Here is a stange problem found with JACL 1.1.1:
> When Shell is started (java -classpath tcljava.jar;jacl.jar
> tcl.lang.Shell), the characters typed after the prompt are NOT printed
> on screen until return is pressed! difficult to type commands ;-)
>
> I have modified tcl.lang.Shell line 278 in method run:
>
> // replaced line sbuf.append(getLine());
>
> try {
> sbuf = new StringBuffer((new BufferedReader(new
> InputStreamReader(System.in))).readLine());
> } catch (IOException e ){
> e.printStackTrace();
> System.exit(0);
> }
>
> It works well but I think I have made mistake somewhere else. a big so
> big can't be a bug!
>
> environnement: windows NT/ jdk1.2
>
> philippe - france
>
>
>
>
> ----------------------------------------------------------------
> The TclJava mailing list is sponsored by WebNet Technologies.
> To subscribe: send mail to [EMAIL PROTECTED]
> with the word SUBSCRIBE as the subject.
> To unsubscribe: send mail to [EMAIL PROTECTED]
> with the word UNSUBSCRIBE as the subject.
> To send to the list, send email to '[EMAIL PROTECTED]'.
> A list archive is at: http://www.findmail.com/listsaver/tcldallas/
>
----------------------------------------------------------------
The TclJava mailing list is sponsored by WebNet Technologies.
To subscribe: send mail to [EMAIL PROTECTED]
with the word SUBSCRIBE as the subject.
To unsubscribe: send mail to [EMAIL PROTECTED]
with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'.
A list archive is at: http://www.findmail.com/listsaver/tcldallas/