fly: behaviour: ignore non-printable chars
I was getting some invisible characters on windows which caused the
token to be malformed - just ignore them.
@@ -29,8 +29,10 @@ func ReadLine(reader io.Reader) ([]byte, error) {
case keyCtrlC:
return nil, ErrInterrupted
default:
+ if isPrintableChar(buf[0]) {
ret = append(ret, buf[0])
}
+ }
continue
}
if err != nil {
@@ -41,3 +43,7 @@ func ReadLine(reader io.Reader) ([]byte, error) {
}
}
}
+
+func isPrintableChar(b byte) bool {
+ return b >= 32
+}
