bash 如何在 cygwin 中关闭哔哔声?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1731700/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 21:24:18  来源:igfitidea点击:

How do I turn the beep slash bell off in cygwin?

bashcygwin

提问by Breck

The system beep/bell happens frequently (ie, when I type a few letters then type tab to autocomplete when there are a few options).

系统哔哔声/铃声经常发生(即,当我输入几个字母时,然后在有几个选项时输入 tab 以自动完成)。

How can I turn this off?

我怎样才能关闭它?

I googled it and tried:

我用谷歌搜索并尝试:

set bell-style none (the command went through but nothing changed)

and

setterm -blength 0 (got a bash command not found)

Thanks!

谢谢!

回答by Emerick Rogul

Add set bell-style noneto .inputrcin your home directory. You need to start a new shell for this to take effect; that may be why your test didn't work.

添加set bell-style none.inputrc您的主目录中。您需要启动一个新的 shell 才能使其生效;这可能就是您的测试无效的原因。

回答by Steven

The default terminal minttyhas built-in options to control the terminal bell.

默认终端mintty具有用于控制终端铃声的内置选项。

  1. Right-click on the background and click "Options..."
  2. Select the "Terminal" section.
  3. Change the "Bell" dropdown to "none"
  1. 右键单击背景,然后单击“选项...”
  2. 选择“终端”部分。
  3. 将“铃声”下拉列表更改为“无”

Note: Here you can also enable or disable the visible bell (terminal flashing) and to highlight the taskbar icon on a bell ring.

注意:您还可以在此处启用或禁用可见铃铛(终端闪烁)并突出显示铃铛上的任务栏图标。

回答by James Cronen

Cut the wire to your speaker. :-)

切断扬声器的电线。:-)

回答by incircuitous

I experienced a series of beeps when I would cat a particular file. The above tips did not silence the bell. In my case, the beeps were due to bullet points that had been copy/pasted into the file. Replacing the bullets with dashes stopped the beeping.

当我抓取特定文件时,我经历了一系列的哔哔声。上述提示并没有使铃声安静下来。就我而言,哔哔声是由于已复制/粘贴到文件中的项目符号引起的。用破折号代替子弹停止了哔哔声。

回答by zombinary

Path to '.inputrc:

'.inputrc 的路径:

'C:\cygwin64\home\<username>\.inputrc

回答by ak.

Use mintty. Among many other advantages over the usual console, the bell is off by default.

使用薄荷。在与普通控制台相比的许多其他优势中,默认情况下铃声是关闭的。