Patch title: Release 87 bulk changes
Abstract:
File: /pliant/linux/network/terminal.pli
Key:
    Removed line
    Added line
module "/pliant/language/unsafe.pli"
module "/pliant/language/stream.pli"
module "/pliant/language/stream/serial.pli"
module "/pliant/language/ui/ansi_terminal.pli"

constant echo false

function terminal
  (var Stream s) open "serial:0" "baud 9600" in+out+nocache+noautopost
function terminal ip
  arg Str ip
  (var Stream s) open (shunt ip="" "serial:0" "tcp://"+ip+"/client/23") "baud 9600" in+out+nocache+noautopost
  var CBool stop := false
  thread
    share s stop
    while not stop
      var Int ch := keyboard_readchar
      if ch=keyboard_break
        stop := true
      eif ch<256
        var Str s1 := " " ; s1 0 := character ch
        if s1="[cr]"
          s1 := "[cr][lf]"
        s writechars s1
        if echo
          console s1
        s flush anytime
      else
        console "?"
  while not stop
    var Str s2 := " "
    s raw_read s2:characters s2:len
    console s2

export terminal