mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-29 06:46:35 -04:00
term: wip: read from PTY in a separate thread
This allows us to buffer much more data from the client while we're rendering. This in turn means we're less likely to block the client from writing, which means the client is much more likely to write all its data. And this means we're less likely to flicker.
This commit is contained in:
parent
e466063020
commit
fd32fa0a0f
2 changed files with 186 additions and 29 deletions
15
terminal.h
15
terminal.h
|
|
@ -210,6 +210,20 @@ struct terminal {
|
|||
|
||||
pid_t slave;
|
||||
int ptmx;
|
||||
struct {
|
||||
thrd_t thread_id;
|
||||
mtx_t lock;
|
||||
cnd_t cond;
|
||||
int event_fd;
|
||||
int size;
|
||||
|
||||
uint8_t idx;
|
||||
struct {
|
||||
uint8_t *data;
|
||||
int len;
|
||||
} buf[2];
|
||||
} ptmx_read_buffer;
|
||||
|
||||
bool quit;
|
||||
|
||||
struct grid normal;
|
||||
|
|
@ -226,6 +240,7 @@ struct terminal {
|
|||
int font_adjustments;
|
||||
enum fcft_subpixel font_subpixel;
|
||||
|
||||
/* TODO: rename to ptmx_write_buffer? */
|
||||
tll(struct ptmx_buffer) ptmx_buffer;
|
||||
|
||||
enum cursor_keys cursor_keys_mode;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue