From 04017c25bb719c31bb18d43b4bcb96c4736f8d91 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 25 Jan 2025 11:22:32 +0900 Subject: Add 'bell' action to ring the terminal bell --- src/tui/light.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/tui/light.go') diff --git a/src/tui/light.go b/src/tui/light.go index f4688060..56e9ae0b 100644 --- a/src/tui/light.go +++ b/src/tui/light.go @@ -32,6 +32,10 @@ const consoleDevice string = "/dev/tty" var offsetRegexp = regexp.MustCompile("(.*)\x1b\\[([0-9]+);([0-9]+)R") var offsetRegexpBegin = regexp.MustCompile("^\x1b\\[[0-9]+;[0-9]+R") +func (r *LightRenderer) Bell() { + r.flushRaw("\a") +} + func (r *LightRenderer) PassThrough(str string) { r.queued.WriteString("\x1b7" + str + "\x1b8") } -- cgit v1.2.3