set port_stty [exec stty -F $port -g]
set term_stty [exec stty -g]
+proc onreadp {} {
+ global p
+ while 1 {
+ set c [read $p 1]
+
+}
+
+proc onreadk {} {
+}
+
set e [catch {
exec stty min 0 time 0 -istrip -ocrnl -onlcr -onocr -opost \
-ctlecho -echo -echoe -echok -echonl -iexten -isig
set p [open $port {RDWR|NONBLOCK} 0]
fconfigure $p -blocking false -buffering none
fconfigure stdin -blocking false -buffering none
- fconfigure stdin -blocking false -buffering none
+
+ fileevent stdin readable onreadk
+ fileevent $p readable onreadp
}]
fconfigure stdin -blocking true