9

I have disabled system beeps locally by adding set bell-style none to my local .inputrc file; however, when remote ssh to machines I will still get system beeps for using TAB for autocomplete, which I do a lot. I know I can modify the remote machine's .inputrc file or the remote accounts .bashrc file, but that is intrusive on machines I do not own. Is there a way to fix this locally.

I am using Windows 10 Ubuntu Bash.

The beeps are slowing driving me insane.

5
  • What SSH client do you use?
    – Ondřej Xicht Světlík
    Jan 11, 2018 at 13:17
  • 1
    OpenSSH, to be more specific OpenSSH_7.2p2 Ubuntu-4ubuntu2.2, OpenSSL 1.0.2g 1 Mar 2016
    – Liam Kelly
    Jan 11, 2018 at 13:22
  • You should look for a configuration option in your Windows terminal emulator to convert bell to a visible bell, like xterm -vb does in Unix.
    – meuh
    Jan 11, 2018 at 16:46
  • I do wonder why you consider it "intrusive" to create personal configuration files on a remote system. I mean, assuming you have an account and a home directory of your own, as usual, that's the usual way to do it. Things get a lot easier if you have a set of configuration files you can copy to any remote system to handle stuff like this.
    – ilkkachu
    Jan 12, 2018 at 10:38
  • It's only intrusive if you are sharing the remote account with others.
    – chepner
    Jan 12, 2018 at 19:51

2 Answers 2

9

You can set readline variables at any time using the bind command, without needing to read an .inputrc file. For example, after you login type

bind 'set bell-style none'

Note how the command has to be a single string. If you want to do this automatically each time you could use a simple expect script taking the remote hostname as argument.

#!/usr/bin/expect -f
spawn ssh [lindex $argv 0]
expect {$ }
send "bind 'set bell-style none'\n"
expect {$ }
interact
0
3

Here's a workaround, first, create a file .inputrc.mine in the home directory of your remote user with line

set bell-style none

then log in to the server using

ssh -t user@server 'export INPUTRC=~/.inputrc.mine; /bin/bash'

Without -t your bash would not work (input/output redirected to the previous command).

6
  • Are you sure that works? Try running set bell-style none; echo "$1"; on an interactive Bash and see what happens.
    – ilkkachu
    Jan 11, 2018 at 16:07
  • 1
    No, it doesn't, you are right. Jan 11, 2018 at 16:25
  • I've added a working solution. Jan 11, 2018 at 16:55
  • ssh -t user@server 'INPUTRC=~/.inputrc.mine /bin/bash' should work as well.
    – chepner
    Jan 12, 2018 at 19:52
  • You are riight. Jan 12, 2018 at 21:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .