[FIX] peek the first character to enable in_avail()
[FIX] final fix for format detection from stdin