如何在Windows 10上禁用WSL中的可视和音频铃声/蜂鸣声?
当前回答
To disable the beep in bash you need to uncomment (or add if not already there) the line set bell-style none in your /etc/inputrc file. Note: Since it is a protected file you need to be a privileged user to edit it (i.e. launch your text editor with something like sudo <editor> /etc/inputrc). To disable the beep and the visual bell also in vim you need to add the following to your ~/.vimrc file: set visualbell set t_vb= To disable the beep also in less (i.e. also in man pages and when using "git diff") you need to add export LESS="$LESS -R -Q" in your ~/.profile file.
其他回答
找到.bash_profile文件的位置,并在文件中输入以下内容:
设置项 -长度 0
它会将哔哔声发生的时间设置为0,因此没有哔哔声。
您需要添加以下行bash和vim配置,
1)把铃声关掉
vi ~/.inputrc
set bell-style none
2)关闭vi的铃声
vi ~/.vimrc
set visualbell
set t_vb=
设置视觉铃声将关闭音频铃声,清除视觉铃声长度将禁用闪烁。
To disable the beep in bash you need to uncomment (or add if not already there) the line set bell-style none in your /etc/inputrc file. Note: Since it is a protected file you need to be a privileged user to edit it (i.e. launch your text editor with something like sudo <editor> /etc/inputrc). To disable the beep and the visual bell also in vim you need to add the following to your ~/.vimrc file: set visualbell set t_vb= To disable the beep also in less (i.e. also in man pages and when using "git diff") you need to add export LESS="$LESS -R -Q" in your ~/.profile file.
要在远程机器中禁用ssh时的哔哔声,只需创建相同的~/。输入和~/。远程计算机上的Vimrc文件,以阻止SSH本身发出哔哔声。
每个文件的内容请看@Nemo的回答。
除了jgr208说的,你可能有一个~/。配置文件已经和~/。Bash_profile可能不存在,我就是这种情况。
在这种情况下,将setterm - length 0添加到.profile中。
如果你创建了.bash_profile,你的.profile将被忽略,Windows在那里写的任何东西都将无法工作。
推荐文章
- RVM不是一个函数,用' RVM use…’不会起作用
- 如何打破一个循环在Bash?
- 如何从终端机发送电子邮件?
- Linux Bash中双&和分号有什么区别?
- 在Bash中模拟do-while循环
- 在Bash中将输出赋给变量
- 如何在Mac OS X 10.6中使硬件发出哔哔声
- 从Docker容器获取环境变量
- 如何重定向标准derr和标准输出到不同的文件在同一行脚本?
- 如何循环通过一个目录递归删除具有某些扩展名的文件
- 在Bash中获取日期(比当前时间早一天)
- Linux: kill后台任务
- 在Windows10上打开/创建内部网络Vagrant失败
- 在OSX中永久设置PATH环境变量
- 删除Bash脚本中的重复条目