[gambit-list] Strange echo in pseudo-terminals on MacOSX10.4 Gambit-Cb14

feeley at iro.umontreal.ca feeley at iro.umontreal.ca
Tue Aug 9 09:08:59 EDT 2005


The echo you are experiencing is the same you would get if you started
this program from the shell, because the pttest program is doing the echo
(that´s how Gambit´s "readline" layer works with ttys, i.e. it is the
Gambit runtime of pttest that is doing the echo including the escape codes
to highlight the input using bold text).  There are a few ways to avoid
this problem.  The simplest is to force the interaction channel to be
directed to stdin/stdout instead of /dev/tty.  This can be done with

    ./pttest -:d-

Marc

> Hi,
>
> Me again... I just separated my questions to different threads...
>
> There is strange echo I get by communicating with a pseudo terminal
> process on MacOSX 10.4 Gambit-Cb14.
> I open a dummy process that is a pseudo-terminal using the open-
> process command and when I send data to the port that data gets
> repeated in the pseudo-terminal output-port. See the example below
> for better clarity. Can I turn off that echo?
>
> I cannot test it on the WinXP platform since open-process is not
> implemented for (MinGW or Cygwin).
>
> Thank you,
> Francois Magnan
>
> ---------------------
>
> ; Pseudo-terminal program
>
>
> (define (command-loop)
>    (let ((command (read-line)))
>      (serve-command command)
>      (command-loop)))
>
>
> (define (serve-command command)
>    (pp (list "got command" command)))
>
>
> (command-loop)
>
>
> ; build the above to an executable file called "/tmp/pttest" using
> gsc and gcc.
>
>
> ---------------------
>
> (define (test-pseudo-terminal)
>    (let ((port (open-process (list
>                               path: "/tmp/pttest"
>                               stderr-redirection: #t
>                               pseudo-terminal: #t ))))
>      ;(force-output port)
>      (pp port)
>      (force-output)
>      (thread-sleep! 1)
>      (display "toto\n" port)
>      (force-output port)
>      (pp (read-line port))
>      (pp (read-line port))
>      (close-port port)))
>
> (test-pseudo-terminal)
>
> ; execute the above in a gsi interpreter
> ; On MacOSX 10.4 I get
> ; "\33[1mtoto\33[m"
> ;"(\"got command\" \"toto\")"
>
>
>
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> http://mailman.iro.umontreal.ca/mailman/listinfo/gambit-list
>




More information about the Gambit-list mailing list