anchor.diff:  
   : input  ( dev-str dev-len -- )
      open-dev ?dup IF
  -      \ Close old stdin:
  -      s" stdin" get-chosen IF
  -         decode-int nip nip ?dup IF close-dev THEN
  +      \ find new ihandle and xt handle
  +      dup s" read" rot ihandle>phandle find-method
  +      0= IF
  +         drop
  +         cr ." Cannot find the read method for the given input console " cr
  +         EXIT
         THEN
  -      \ Now set the new stdin:
  -      encode-int s" stdin"  set-chosen
  +      to read-xt
  +      set-stdin
      THEN
   ;
   
  
positive.code: ' term-io-emit to emit
  
  : term-io-key  ( -- char )
     s" stdin" get-chosen IF
        decode-int nip nip dup 0= IF 0 EXIT THEN
        >r BEGIN
           (term-io-char-buf) 1 s" read" r@ $call-method
           0 >
        UNTIL
        (term-io-char-buf) c@
        r> drop
     ELSE
        [ ' key behavior compile, ]
     THEN
  ;
  
  
negative.code: \ - if it's an hv console, use hvterm-key?
  \ otherwise it will always return false
  : term-io-key?  ( -- true|false )
    stdin @ ?dup IF
        >r \ store ihandle on return stack
        s" device_type" r@ ihandle>phandle ( propstr len phandle )
        get-property ( true | data dlen false )
  