QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1003|回复: 12

怎样设置消除vi、less、等程式的喇叭响声

[复制链接]
发表于 2003-10-18 16:58:42 | 显示全部楼层 |阅读模式
/etc/inputrc文件
------------
  set bell-style none
-------------

这个已经设置,可以消除控制台的喇叭声,但在vi、less里还是一样响,怎么弄?
发表于 2003-10-18 17:47:08 | 显示全部楼层
设置--》响铃--》无
回复

使用道具 举报

 楼主| 发表于 2003-10-20 08:21:30 | 显示全部楼层
楼上真优墨,黑得发亮
回复

使用道具 举报

发表于 2003-10-20 08:42:54 | 显示全部楼层
他说的没错,不过是给konsole用的
回复

使用道具 举报

 楼主| 发表于 2003-10-20 09:47:39 | 显示全部楼层
听着VI,VIM,LESS,MAN里边的哔哔声,真是不胜其烦啊!

谁能救我出苦海?
回复

使用道具 举报

 楼主| 发表于 2003-10-22 13:19:12 | 显示全部楼层
版主救我
回复

使用道具 举报

 楼主| 发表于 2003-10-24 10:17:59 | 显示全部楼层
没有人知道吗
我搜索过没搜到才问的,请大家帮我
回复

使用道具 举报

发表于 2003-10-24 18:50:35 | 显示全部楼层
vi中set vb
回复

使用道具 举报

 楼主| 发表于 2003-10-25 08:50:55 | 显示全部楼层
楼上set vb的确好使,但只在VI/M里好使。到LESS\MAN里边还是一样。
回复

使用道具 举报

 楼主| 发表于 2003-10-25 15:19:04 | 显示全部楼层
是set noeb,上面说错了,这也不行。
回复

使用道具 举报

发表于 2003-10-25 22:56:50 | 显示全部楼层
Here is a feasible way I have tested(just feasible, but not easy )

open the file: /usr/src/linux-2.4/drivers/char/vt.c and, locate the following code:

#if defined(__i386__) || defined(__alpha__) || defined(CONFIG_PPC_ISATIMER) \
    || (defined(__mips__) && defined(CONFIG_ISA)) \
    || (defined(__arm__) && defined(CONFIG_HOST_FOOTBRIDGE)) \
    || defined(__x86_64__)

static void
kd_nosound(unsigned long ignored)
{
        /* disable counter 2 */
        outb(inb_p(0x61)&0xFC, 0x61);
        return;
}

void
_kd_mksound(unsigned int hz, unsigned int ticks)
{
        static struct timer_list sound_timer = { function: kd_nosound };
        unsigned int count = 0;
        unsigned long flags;

        if (hz > 20 && hz < 32767)
                count = 1193180 / hz;
       
        save_flags(flags);
        cli();
        del_timer(&sound_timer);
        if (count) {
                /* enable counter 2 */
                outb_p(inb_p(0x61)|3, 0x61);
                /* set command for counter 2, 2 byte write */
                outb_p(0xB6, 0x43);
                /* select desired HZ */
                outb_p(count & 0xff, 0x42);
                outb((count >> & 0xff, 0x42);

                if (ticks) {
                        sound_timer.expires = jiffies+ticks;
                        add_timer(&sound_timer);
                }
        } else
                kd_nosound(0);
        restore_flags(flags);
        return;
}

#else

void
_kd_mksound(unsigned int hz, unsigned int ticks)
{
}

now what you should do is to delete the implementation of the fuction _kd_mksound() before "#else" and then rebuid your kernel
(the code after being deleted looks like:

#if defined(__i386__) || defined(__alpha__) || defined(CONFIG_PPC_ISATIMER) \
    || (defined(__mips__) && defined(CONFIG_ISA)) \
    || (defined(__arm__) && defined(CONFIG_HOST_FOOTBRIDGE)) \
    || defined(__x86_64__)

static void
kd_nosound(unsigned long ignored)
{
        /* disable counter 2 */
        outb(inb_p(0x61)&0xFC, 0x61);
        return;
}

void
_kd_mksound(unsigned int hz, unsigned int ticks)
{
}

#else

void
_kd_mksound(unsigned int hz, unsigned int ticks)
{
}
or more simply:

#if defined(__i386__) || defined(__alpha__) || defined(CONFIG_PPC_ISATIMER) \
    || (defined(__mips__) && defined(CONFIG_ISA)) \
    || (defined(__arm__) && defined(CONFIG_HOST_FOOTBRIDGE)) \
    || defined(__x86_64__)

static void
kd_nosound(unsigned long ignored)
{
        /* disable counter 2 */
        outb(inb_p(0x61)&0xFC, 0x61);
        return;
}
#endif

void
_kd_mksound(unsigned int hz, unsigned int ticks)
{
}
)
回复

使用道具 举报

 楼主| 发表于 2003-10-27 08:55:21 | 显示全部楼层
conke,

哇,太感谢您了!

“There is only one OS,linux, that runs on my PC these years. ”
你真行!PFPF!
回复

使用道具 举报

发表于 2003-10-27 09:30:57 | 显示全部楼层
Here are the suggestions so far:

GNOME
-----
    Control Center|Peripherals|Keyboard|Keyboard bell

GNOME terminal
--------------
    Settings|Preferences|Silence Terminal Bell

xterm  (put in ~/.xsession)
-----
    xset b off

bash  (put in /etc/inputrc or ~/.inputrc )
----
    set bell-style none

tcsh   (put in ~/.cshrc
----
    set nobeep

vim   (put in ~/.vimrc)
---
    set vb

all
---
    (tear out speakers)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-9-20 17:55 , Processed in 0.044805 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表