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.
This commit is contained in:
nicm
2020-03-24 08:09:43 +00:00
parent edca27ae45
commit 8a838b0372
12 changed files with 749 additions and 36 deletions

19
job.c
View File

@ -17,6 +17,7 @@
*/
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <fcntl.h>
@ -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)