mirror of
https://github.com/tmux/tmux.git
synced 2025-09-03 14:27:09 +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:
1
tmux.h
1
tmux.h
@ -1203,6 +1203,7 @@ struct tty {
|
|||||||
#define TTY_OPENED 0x20
|
#define TTY_OPENED 0x20
|
||||||
#define TTY_FOCUS 0x40
|
#define TTY_FOCUS 0x40
|
||||||
#define TTY_BLOCK 0x80
|
#define TTY_BLOCK 0x80
|
||||||
|
#define TTY_NOBLOCK 0x100
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
struct tty_term *term;
|
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);
|
size_t size = EVBUFFER_LENGTH(tty->out);
|
||||||
struct timeval tv = { .tv_usec = TTY_BLOCK_INTERVAL };
|
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))
|
if (size < TTY_BLOCK_START(tty))
|
||||||
return (0);
|
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);
|
int flags = (tty->term->flags|tty->term_flags);
|
||||||
|
|
||||||
if ((flags & TERM_SIXEL) || tty_term_has(tty->term, TTYC_SXL)) {
|
if ((flags & TERM_SIXEL) || tty_term_has(tty->term, TTYC_SXL)) {
|
||||||
|
tty->flags |= TTY_NOBLOCK;
|
||||||
tty_add(tty, ctx->ptr, ctx->num);
|
tty_add(tty, ctx->ptr, ctx->num);
|
||||||
if (!ctx->more)
|
if (!ctx->more)
|
||||||
tty_invalidate(tty);
|
tty_invalidate(tty);
|
||||||
|
Reference in New Issue
Block a user