[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: visual bell

On Friday 26 July 2002 01:30 pm, you wrote:
> On Thu, 2002-07-25 at 11:39, Charles Menzes wrote:
> > is there a way of setting the terminal bell to visual in bash?
> This isn't strictly what you asked, but you can set screen to use visual
> bells (in fact, I believe it does a visual-bell-thing by default) and
> run your shells in it.

Jeff's on the right path. What you want to look for is visual bell support in 
your *terminal* emulation/definition (i.e. termcap/terminfo/curses/ncurses).

It is most likely you will have to find or define the 'visual bell' 
representation in your terminal's termcap/terminfo.

This is all handled by the curses routines for beep and flash, respectively.

You may need to use infocmp to decompile your terminfo definition for your 
terminal (probably xterm or linux (for the console)).

You will need to then edit this text file to mark it as a "-vb" (or visual 
bell) version for your termcap entry. e.g. linux-vb and xterm-vb.

You will want to rename the terminal type on the first line, and then remove 
the definition of the 'bell' entry.

You can see this by comparing the defnitions of the wyse60 and the wyse60-vb 

$ infocmp -d wyse60 wyse60-vb
comparing wyse60 to wyse60-vb.
    comparing booleans.
    comparing numbers.
    comparing strings.
        bel: '^G', NULL.

The only difference is that the wyse60 entry defines the 'bel' attribute and 
the wyse60-vb does not.

So, generate your terminfo source code (using infocmp -I <terminal_type>),
remove the definition of 'bel' and add '-vb' to the terminal type definition 
on the first line. Name your file terminal_type-vb by adding a -vb suffix.
Then add a .src extension if you want to note that it is the source version 

Run it through 'tic' to compile it and add it to your terminfo database.

Then change your terminal to 'linux-vb' or 'xterm-vb' using the 'tset' 

Then, anything that uses curses will also use the visual bell.

If you want *both* the visual bell and the audible one, then you will have to 
look into the ncurses source code to see if that can be done (you might have 
to call 'flash' from 'bell').

Luckily, since you use an Open Source product, you have this option - to make 
it do what you want it to if it matters that much to you.

() Join the ASCII ribbon campaign against HTML email and Microsoft-specific
/\ attachments. If I wanted to read HTML, I would have visited your website!
Support open standards.

To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.