dvtm

dynamic virtual terminal manager - with my changes
git clone https://pi.duncano.de/git/dvtm.git
Log | Files | Refs | README | LICENSE

commit 0911f18fdcea867fecc9f259c9af8e2b6b83c10b
parent af99c6eeb114bd6f560f966a60fbed2a92086ee0
Author: Marc Andre Tanner <mat@brain-dump.org>
Date:   Thu, 18 Jun 2009 18:45:12 +0200

Introduce madtty_{bell,togglebell} to beep on terminal bell.

The beep is off by default.

Based on a patch by Sumedha Widyadharma.

Diffstat:
madtty.c | 15++++++++++++++-
madtty.h | 3+++
2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/madtty.c b/madtty.c @@ -100,6 +100,7 @@ struct madtty_t { unsigned graphmode : 1; unsigned curshid : 1; unsigned curskeymode: 1; + unsigned bell : 1; /* geometry */ int rows, cols; @@ -767,7 +768,9 @@ static void madtty_process_nonprinting(madtty_t *t, wchar_t wc) break; case C0_BEL: - /* do nothing for now... maybe a visual bell would be nice? */ + /* maybe a visual bell would be nice? */ + if(t->bell) + beep(); break; case C0_BS: @@ -1184,6 +1187,16 @@ void madtty_noscroll(madtty_t *t) madtty_scroll(t, t->scroll_amount); } +void madtty_bell(madtty_t *t, bool bell) +{ + t->bell = bell; +} + +void madtty_togglebell(madtty_t *t) +{ + t->bell = !t->bell; +} + /******************************************************/ pid_t madtty_forkpty(madtty_t *t, const char *p, const char *argv[], const char *env[], int *pty) diff --git a/madtty.h b/madtty.h @@ -75,4 +75,7 @@ void madtty_color_set(WINDOW *win, short fg, short bg); void madtty_scroll(madtty_t *, int rows); void madtty_noscroll(madtty_t *); +void madtty_bell(madtty_t *, bool bell); +void madtty_togglebell(madtty_t *); + #endif /* MADTTY_MADTTY_H */