summaryrefslogtreecommitdiffstats
path: root/job.c
diff options
context:
space:
mode:
authornicm <nicm>2020-03-24 08:09:43 +0000
committernicm <nicm>2020-03-24 08:09:43 +0000
commit8a838b0372163e1a7c0379991545a55028bb9eba (patch)
treee661c7515692850627863e31a357c2305f4dabcd /job.c
parentedca27ae45db7be104bc56a4e48e55cddc40acdb (diff)
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.
Diffstat (limited to 'job.c')
-rw-r--r--job.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/job.c b/job.c
index c31d51b2..997a6574 100644
--- a/job.c
+++ b/job.c
@@ -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)