From 8a838b0372163e1a7c0379991545a55028bb9eba Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 24 Mar 2020 08:09:43 +0000 Subject: Add support for overlay popup boxes to show text or output temporarily above the normal layout. These work similarly to menus and are created with the display-popup command. --- job.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'job.c') diff --git a/job.c b/job.c index c31d51b2..997a6574 100644 --- a/job.c +++ b/job.c @@ -17,6 +17,7 @@ */ #include +#include #include #include @@ -205,6 +206,24 @@ job_free(struct job *job) free(job); } +/* Resize job. */ +void +job_resize(struct job *job, u_int sx, u_int sy) +{ + struct winsize ws; + + if (job->fd == -1 || (~job->flags & JOB_PTY)) + return; + + log_debug("resize job %p: %ux%u", job, sx, sy); + + memset(&ws, 0, sizeof ws); + ws.ws_col = sx; + ws.ws_row = sy; + if (ioctl(job->fd, TIOCSWINSZ, &ws) == -1) + fatal("ioctl failed"); +} + /* Job buffer read callback. */ static void job_read_callback(__unused struct bufferevent *bufev, void *data) -- cgit