This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: 'read' not echoing characters


That is something of a FAQ for Kawa.

The problem is that SysInPort checks InputStream.available() before trying 
to read any characters.  But the Windows console reader buffers lines (for 
the edit functions of course), and so doesn't update that on a 
per-character basis, and neither does it echo because it doesn't yet know 
what kind of read the application is going to do.

Per wrote a couple weeks ago:
>Kevin Gilpin wrote:
>When I start up kawa.repl, I am able to enter expressions and evaluate them.
>However, the characters that I type are not echoed to the terminal until I
>press Enter. Needless to say this is quite a usability problem.
>Is this a known problem with a fix.
>It's a known problem. I don't know if this is a bug in Sun's 
>implementation of
>System.in, or some weird interaction due to the implementation of SysInPort,
>or something else.
>A work-around is to start up Kawa with the -w flag, or type the 
>(scheme-window)
>expression. Either creates a new window.

jim

At 06:31 PM 9/16/2001 +0100, Jocelyn Paine wrote:
>I've compiled a Kawa application which reads S-expressions and processes
>them in a command loop into a class with a main method using the --main
>option. I run it under Windows NT, by invoking the class from a DOS window
>with 'java <classname>'. The call of (read) reads what I type, but doesn't
>echo the characters until after I hit return, which means I can't see what
>I'm typing.
>
>Is Kawa behaving correctly here? I couldn't find in R5S5 any indication
>that I should be using some kind of port other than the default. Or is it
>a fummy with Windows Kawa, in which case a circumvention would be very
>much appreciated.
>
>Just for the record, here's the program:
>   (module-name 'test)
>   (module-static #t)
>
>   (define input #!null)
>     (invoke (static-field <java.lang.System> 'out) 'println "Hello\n" )
>     (display "Hello") (newline)
>     (set! input (read))
>     (display "You input ") (display input) (newline)
>
>If I type the single symbol a, say, it doesn't echo this until after
>I hit return.
>
>Jocelyn Paine
>http://www.ifs.org.uk/~popx/
>+44 (0)7768 534 091

----------------------------------------------------------------
James P. White                 Netscape DevEdge Champion for IFC
IFC Exchange   *   Insanely great Java   *   http://www.ifcx.org
jim@pagesmiths.com Pagesmiths' home is http://www.pagesmiths.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]