Visible bell mini-Howto: Defining a visible bell

prev-8410501 next-1403867 toc-6815982

You can add the entry for the vb capability in your own termcap file. Dennis Henriksen (duke@diku.dk) suggested to insert the following line in the termcap entry for console:


:vb=\E7\E[?5h\E[?5l\E[?5h\E[?5l\E[?5h\E[?5l\E[?5h\E[?5l\E8:\

The trailing backslash is used to escape the newline in the database. Dennis’ code does the following (his own words):

  • Save the cursor position (Just a safety precaution)
  • Change the background color several times between normal and reverse
  • Restore the cursor position.

Some warnings about modifying termcap:

  • Check what your TERM variable looks like: it used to be « console », but it depends on your distribution and kernel version. Actually, it is due to change to « linux ».
  • Check if the vb field is already there, distributors are reading docs and upgrading their software all the time.
  • Some applications don’t use termcap but the terminfo database. They won’t sense your vb entry. Terminfo is more powerful than termcap, as well as more difficult.

prev-8410501 next-1403867 toc-6815982

READ  Bob Young Speaks at LXNY LG #47