mirror of
https://github.com/tmux/tmux.git
synced 2025-01-05 23:38:48 +00:00
Add a flag to disable blocking while sending a SIXEL image (turned off when the
buffer hits 0 size).
This commit is contained in:
parent
968382aa6a
commit
a5b1e20941
1
tmux.h
1
tmux.h
@ -1203,6 +1203,7 @@ struct tty {
|
||||
#define TTY_OPENED 0x20
|
||||
#define TTY_FOCUS 0x40
|
||||
#define TTY_BLOCK 0x80
|
||||
#define TTY_NOBLOCK 0x100
|
||||
int flags;
|
||||
|
||||
struct tty_term *term;
|
||||
|
6
tty.c
6
tty.c
@ -211,6 +211,11 @@ tty_block_maybe(struct tty *tty)
|
||||
size_t size = EVBUFFER_LENGTH(tty->out);
|
||||
struct timeval tv = { .tv_usec = TTY_BLOCK_INTERVAL };
|
||||
|
||||
if (size == 0)
|
||||
tty->flags &= ~TTY_NOBLOCK;
|
||||
else if (tty->flags & TTY_NOBLOCK)
|
||||
return (0);
|
||||
|
||||
if (size < TTY_BLOCK_START(tty))
|
||||
return (0);
|
||||
|
||||
@ -1872,6 +1877,7 @@ tty_cmd_rawsixel(struct tty *tty, const struct tty_ctx *ctx)
|
||||
int flags = (tty->term->flags|tty->term_flags);
|
||||
|
||||
if ((flags & TERM_SIXEL) || tty_term_has(tty->term, TTYC_SXL)) {
|
||||
tty->flags |= TTY_NOBLOCK;
|
||||
tty_add(tty, ctx->ptr, ctx->num);
|
||||
if (!ctx->more)
|
||||
tty_invalidate(tty);
|
||||
|
Loading…
Reference in New Issue
Block a user