5

I'm running a nearly vanilla installation of OS X Yosemite 10.10.1 with the usual Homebrew, MacPorts, and Fink. I have barely anything installed with these utilities. For some reason, my Terminal.app is not producing an audible bell, even with the preference enabled. I have since enabled the visual bell, and at first it didn't produce a result either until I disabled the "Only when sound is muted" option. I do not have my system's default audio device muted; it is in fact at 100% volume and fully functional. It seems like Terminal.app is under the impression that my system audio is muted for some reason. How can I get my Terminal.app to beep like it did in past versions of OS X?

3 Answers 3

6

I came here via a search as I was experiencing exactly the same issue and tried all the steps suggested to Clay Freeman with the same results.

What worked for me was going into Systems Preferences / Sound, where I noticed that the slider for Alert Volume was at its leftmost setting. Sliding that to the right resolved the problem.

3
  • Wow. I can't believe that this was the problem. My main question is why I could still hear alerts for other things! Jan 9, 2015 at 8:24
  • Although I didn't have this issue, it gave me an idea. After updating the system, it needed to be restarted.
    – B Seven
    Nov 2, 2016 at 18:08
  • For some reason, the alert sound had to be re-selected.
    – B Seven
    Nov 2, 2016 at 18:19
7

There are several ways to do this on Terminal, but first make sure that in Terminal preferences > Advanced you have ticked the Audible bell option, otherwise you won't hear anything. Now you can do any of the following to get the bell:

  • $ echo ^G (hold down the ctrl key followed by V and then G to get ^G)
  • $ printf "\a" or $ printf \\a
  • $ echo -e "\a" or $ echo -e \\a
  • $ tput bel

FYI: the way you installed Yosemite, whether via Homebrew, Macports etc., shouldn't affect this issue.

3
  • I know how to initiate the audible bell, but the problem is that it won't play, even when manually attempting to trigger it via the bell character. Dec 27, 2014 at 9:10
  • I enabled the audible bell on my system and I get the sound usually produced when taking a screenshot. It might be that @ClayFreeman has something silent set. I did not find where to change the bell sound ...
    – Matteo
    Dec 27, 2014 at 10:09
  • It uses the default system sound; mine is currently set to "Funk." Dec 27, 2014 at 11:01
2
  1. On your Terminal what are the Bell options you have set in Preferences > Advanced? As I said before, Audible bell and Visual bell should be ticked, otherwise that's the problem.

  2. Did you check that you can play other system sounds? The standard system sound files for alerts are located in /System/Library/Sounds, and can be played from Terminal using afplay. Try doing the following

    $ afplay /System/Library/Sounds/Funk.aiff

You should be able to hear the sound.

  1. If not, then it could be a problem with value for the bell setting in the terminfo for terminal - terminfo is an internal database of terminal settings files that Terminal.app uses to perform actions for different terminal types - a collection of different settings files for different terminals. The standard one is xterm-256color - you can find out which one by doing

    $ echo $TERM

you should see xterm-256color. The settings file for this terminal is a binary file located in a numbered subfolder of /usr/share/terminfo, to find out which one do

$ mdfind xterm-256color

You should see several lines, the first which should be something like /usr/share/terminfo/78, in which case that's where the settings file for xterm-256color is located. Since it is a binary file you won't be able to read it out literally, but must do the following

$ infocmp

to print it out in human-readable form. This is a long string of key-value pairs for different settings - to find out the bell settings for your terminal you can either manually scan the output for bel=^G or do

$ infocmp | grep bell

and you will see something like bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l. The bel=^G key-pair is saying that using echo or printf followed by ^G (the key combination ctrl+V+G) from your terminal will produce the audible bell (using whatever standard system sound you are using, e.g. the Funk sound /System/Library/Sounds/Funk.aiff. Using tput you can use the capability name bel to sound the bell also by doing $ tput bel.

OK, so tell me what you see when you have done this. If the file is corrupted or damaged or the value is missing, or there is something you should be able to identify it.

6
  • I just checked and everything looks the same as yours. It beeps with the afplay command, but when using tput bel nothing plays. Dec 28, 2014 at 6:46
  • @clay-freeman, it seems odd that tput bel does not beep. I think your problem is related to the terminfo database. Do this: in your terminal window, after tput bel do echo $? to get the exit code of tput bel - it should print 0 if it exited successfully, in which you will/should have heard the beep, otherwise it will print a positive integer indicating some error. There are different error codes, these are explained in the diagnostics section of the tput manual page.
    – ramius
    Dec 29, 2014 at 21:54
  • It returned 0. I can see a visual bell, but still no audio. Dec 30, 2014 at 5:55
  • That's strange. It may be highly specific to your pre- and post-installation setup, but may not matter very much and may well disappear after a future upgrade. But basically you can get Terminal.app to beep using afplay, so hopefully that should be OK for you.
    – ramius
    Dec 30, 2014 at 15:58
  • I'd prefer it to trigger on the bell character like it always has before. I use it often due to unreliable internet to know when my service resumes, and also when using IRC. Dec 31, 2014 at 4:14

You must log in to answer this question.

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