aboutsummaryrefslogtreecommitdiff
path: root/tty-write.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-07-23 12:38:01 +0000
committerTiago Cunha <tcunha@gmx.com>2009-07-23 12:38:01 +0000
commit9c6fa9085735d800643e2052a6d0d34ae4ee1344 (patch)
tree1bfcd36e8153ee6bb323e3cc8ae1e85f3f5c3834 /tty-write.c
parent83d1f2b4801d0bdbfbe9fac5cd544a86afbd1929 (diff)
downloadrtmux-9c6fa9085735d800643e2052a6d0d34ae4ee1344.tar.gz
rtmux-9c6fa9085735d800643e2052a6d0d34ae4ee1344.tar.bz2
rtmux-9c6fa9085735d800643e2052a6d0d34ae4ee1344.zip
Sync OpenBSD patchset 160:
enum tty_cmd is only used as an index into the array of command function pointers, so remove it and use the function pointers directly to represent themselves.
Diffstat (limited to 'tty-write.c')
-rw-r--r--tty-write.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/tty-write.c b/tty-write.c
index 08c2981b..a74b6722 100644
--- a/tty-write.c
+++ b/tty-write.c
@@ -1,4 +1,4 @@
-/* $Id: tty-write.c,v 1.20 2009-07-22 18:08:56 tcunha Exp $ */
+/* $Id: tty-write.c,v 1.21 2009-07-23 12:38:01 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -23,39 +23,39 @@
#include "tmux.h"
void
-tty_write0(struct window_pane *wp, enum tty_cmd cmd)
+tty_write0(struct window_pane *wp, tty_cmd_func *cmdfn)
{
struct tty_ctx ctx;
memset(&ctx, 0, sizeof ctx);
ctx.wp = wp;
- tty_write_cmd(cmd, &ctx);
+ tty_write(cmdfn, &ctx);
}
void
-tty_writenum(struct window_pane *wp, enum tty_cmd cmd, u_int num)
+tty_writenum(struct window_pane *wp, tty_cmd_func *cmdfn, u_int num)
{
struct tty_ctx ctx;
memset(&ctx, 0, sizeof ctx);
ctx.wp = wp;
ctx.num = num;
- tty_write_cmd(cmd, &ctx);
+ tty_write(cmdfn, &ctx);
}
void
-tty_writeptr(struct window_pane *wp, enum tty_cmd cmd, void *ptr)
+tty_writeptr(struct window_pane *wp, tty_cmd_func *cmdfn, void *ptr)
{
struct tty_ctx ctx;
memset(&ctx, 0, sizeof ctx);
ctx.wp = wp;
ctx.ptr = ptr;
- tty_write_cmd(cmd, &ctx);
+ tty_write(cmdfn, &ctx);
}
void
-tty_write_cmd(enum tty_cmd cmd, struct tty_ctx *ctx)
+tty_write(tty_cmd_func *cmdfn, struct tty_ctx *ctx)
{
struct window_pane *wp = ctx->wp;
struct client *c;
@@ -77,9 +77,10 @@ tty_write_cmd(enum tty_cmd cmd, struct tty_ctx *ctx)
continue;
if (c->session->curw->window == wp->window) {
+ if (c->tty.flags & TTY_FREEZE || c->tty.term == NULL)
+ continue;
tty_update_mode(&c->tty, c->tty.mode & ~MODE_CURSOR);
-
- tty_write(&c->tty, cmd, ctx);
+ cmdfn(&c->tty, ctx);
}
}
}