mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-22 05:33:45 -04:00
term: asynchronous writes to slave
Make ptmx non-blocking. Then, when writing data to the slave would have blocked, use the FDM to asynchronously write the remaining data. This is done by enabling EPOLLOUT on ptmx, and enqueueing all outgoing data. The FDM handler will go through the enqueued data, and once all of it has been written, we turn off EPOLLOUT again (thus switching back to synchronous writes)
This commit is contained in:
parent
777d851282
commit
f00c5fdac6
2 changed files with 106 additions and 21 deletions
|
|
@ -145,6 +145,12 @@ enum mouse_reporting {
|
|||
|
||||
enum cursor_style { CURSOR_BLOCK, CURSOR_UNDERLINE, CURSOR_BAR };
|
||||
|
||||
struct ptmx_buffer {
|
||||
void *data;
|
||||
size_t len;
|
||||
size_t idx;
|
||||
};
|
||||
|
||||
struct terminal {
|
||||
struct fdm *fdm;
|
||||
|
||||
|
|
@ -152,6 +158,8 @@ struct terminal {
|
|||
int ptmx;
|
||||
bool quit;
|
||||
|
||||
tll(struct ptmx_buffer) ptmx_buffer;
|
||||
|
||||
enum cursor_keys cursor_keys_mode;
|
||||
enum keypad_keys keypad_keys_mode;
|
||||
bool reverse;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue