3 ms·
> How would you design a simple text outputting protocol? If I were to design terminal control today, I might have a separate file descriptor for a pipe that i
by thayne 4y ago
> How would you design a simple text outputting protocol?
If I were to design terminal control today, I might have a separate file descriptor for a pipe that is used for control communication instead of sending control codes inline with the text. And I would definitely have a way to query the capabilities of the terminal directly, instead of looking it up in a terminfo database.
- Dylan16807 4y ago> I might have a separate file descriptor for a pipe that is used for control communication instead of sending control codes inline with the text. How do you keep that synchronized with the text for things like moving the cursor between words?
- account42 4y agoHaving all data in a single steam also makes it easier to buffer messages like a complete log entry with colors and then output that by just writing one buffer to stdout.