From cfd4d1afc68dfff5833c0873ddc88a0cef978fca Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 24 Aug 2011 09:58:45 +0000 Subject: Add a tty_bell wrapper function, from Dylan Alex Simon. --- usr.bin/tmux/server-window.c | 8 ++++---- usr.bin/tmux/tmux.h | 3 ++- usr.bin/tmux/tty.c | 8 +++++++- 3 files changed, 13 insertions(+), 6 deletions(-) (limited to 'usr.bin/tmux') 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 @@ -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 @@ -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 @@ -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); +} -- cgit v1.2.3