diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2011-08-24 09:58:45 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2011-08-24 09:58:45 +0000 |
commit | cfd4d1afc68dfff5833c0873ddc88a0cef978fca (patch) | |
tree | c131bc3c289cd212963e40ecdd17fd9d5b49504e /usr.bin/tmux | |
parent | dc300621949fc579b5a269f4d22a4422e8148959 (diff) |
Add a tty_bell wrapper function, from Dylan Alex Simon.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/server-window.c | 8 | ||||
-rw-r--r-- | usr.bin/tmux/tmux.h | 3 | ||||
-rw-r--r-- | usr.bin/tmux/tty.c | 8 |
3 files changed, 13 insertions, 6 deletions
diff --git a/usr.bin/tmux/server-window.c b/usr.bin/tmux/server-window.c index d89e0d482e8..4ae2685301b 100644 --- a/usr.bin/tmux/server-window.c +++ b/usr.bin/tmux/server-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-window.c,v 1.21 2011/07/03 19:07:54 nicm Exp $ */ +/* $OpenBSD: server-window.c,v 1.22 2011/08/24 09:58:44 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -86,7 +86,7 @@ server_window_check_bell(struct session *s, struct winlink *wl) if (c == NULL || c->session != s) continue; if (!visual) { - tty_putcode(&c->tty, TTYC_BEL); + tty_bell(&c->tty); continue; } if (c->session->curw->window == w) { @@ -108,7 +108,7 @@ server_window_check_bell(struct session *s, struct winlink *wl) if (c->session->curw->window != w) continue; if (!visual) { - tty_putcode(&c->tty, TTYC_BEL); + tty_bell(&c->tty); continue; } status_message_set(c, "Bell in current window"); @@ -254,6 +254,6 @@ ring_bell(struct session *s) for (i = 0; i < ARRAY_LENGTH(&clients); i++) { c = ARRAY_ITEM(&clients, i); if (c != NULL && c->session == s) - tty_putcode(&c->tty, TTYC_BEL); + tty_bell(&c->tty); } } diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index bf90883dd27..cc0d1e3db37 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.292 2011/07/02 21:05:44 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.293 2011/08/24 09:58:44 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -1458,6 +1458,7 @@ void tty_cmd_utf8character(struct tty *, const struct tty_ctx *); void tty_cmd_reverseindex(struct tty *, const struct tty_ctx *); void tty_cmd_setselection(struct tty *, const struct tty_ctx *); void tty_cmd_rawstring(struct tty *, const struct tty_ctx *); +void tty_bell(struct tty *); /* tty-term.c */ extern struct tty_terms tty_terms; diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index 17b0ba6dddb..b38996f01ca 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.109 2011/05/26 07:08:48 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.110 2011/08/24 09:58:44 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -1546,3 +1546,9 @@ tty_try_88(struct tty *tty, u_char colour, const char *type) tty_puts(tty, s); return (0); } + +void +tty_bell(struct tty *tty) +{ + tty_putcode(tty, TTYC_BEL); +} |