LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   /etc/termcap includes visible bell for linux console? (http://www.linuxquestions.org/questions/slackware-14/etc-termcap-includes-visible-bell-for-linux-console-4175427273/)

lolnameless 09-14-2012 11:51 AM

/etc/termcap includes visible bell for linux console?
 
if you use visible bell (i think most people do!)

if on bash or readline be sure you set bell-style visible on inputrc

then,

add this line on /etc/termcap
under the "#Slackware 3.1 liunx...." session
:vb=\E7\E[?5h\E[?5l\E8:\

done!

kind of weird,
it's a basic feature but it needs this line to get the visible bell to work, i don't think people know how unless they search for it....
indeed, most other $TERM we uses today uses terminfo or it just works anyway
but i use the plain linux console often, too.

Alien Bob 09-15-2012 04:46 AM

Quote:

Originally Posted by lolnameless (Post 4780448)
if you use visible bell (i think most people do!)

if on bash or readline be sure you set bell-style visible on inputrc

then,

add this line on /etc/termcap
under the "#Slackware 3.1 liunx...." session
:vb=\E7\E[?5h\E[?5l\E8:\

done!

kind of weird,
it's a basic feature but it needs this line to get the visible bell to work, i don't think people know how unless they search for it....
indeed, most other $TERM we uses today uses terminfo or it just works anyway
but i use the plain linux console often, too.

Hey lolnameless

Care to add this as a new small HOTWO page in the Slackware Documentation Wiki? This is literally the first time I saw how to enable visual bell.
See http://docs.slackware.com/


Cheers, Eric

onebuck 09-16-2012 07:26 AM

Member Response
 
Hi,

Not one to re-invent the wheel, there is a visual bell mini HOWTO already written;
Visible bell mini-Howto - The Linux Documentation Project
This howto does show the user how to change the visual bell;
Quote:

6. Defining a Visible Bell
You can add the entry for the vb capability in your own termcap file, if it doesn't already define one. Dennis Henriksen (duke@diku.dk) suggested to insert the following line in the termcap entry for linux (note that the entry is called console in old distributions):
: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 (uust a safety precaution).
  • Change the background color several times between normal and reverse.
  • Restore the cursor position.

Plus from the same author of the above howto in article format: https://www.linux.com/learn/docs/ldp/811-Visual-Bell.

One caution as noted by the author;
Quote:

9. The Dark Side of the Problem

The bad news is that not every application uses termcap or terminfo. Most small programs feature 'backslash-a' (alarm) characters in the C source code. The "alarm" code becomes a literal ASCII BEL in the strings as stored in the executable binary. Real application don't usually fall in this category, but be careful of C newcomers who give you their own programs. Students of computer science are the worst of all, granted.
The only way to make these programs silent applications is spekearectomy, or using the escape sequences by Martin Mares.


All times are GMT -5. The time now is 09:20 AM.