pfalcon/picotui

Rework terminal input handling

pfalcon opened this issue · 0 comments

Currently, picotui assumes that a single read from terminal returns a single integral sequence of bytes corresponding to:

  1. A complete escape sequence.
  2. A complete UTF-8 char.

This kinda works on a non-loaded Linux system, but doesn't hold in the general case: what the terminal outputs are just raw bytes, and sequences can be partitioned in any way among them, e.g. not complete sequences can be read, or multiple sequences can be read at once, or arbitrary mix thereof.