Search code examples
cwindowscygwin

No sound with \a in cygwin


I'm doing some coding using cygwin with c programming. There is no sound with \a. Do I have to install some packages? There is no problem with cl compiler.

#include <stdio.h>

int main()
{
    printf("\a");

    return 0;
} 

with the following setting

gcc test.c -o fun.exe


Solution

  • I am going to guess that it has something to do with the terminal emulator you are using. I am using mintty. When I edit the options, I am able to specify the behavior of "Bell".

    enter image description here

    When uncheck "Sound" I don't hear anything. When I check "Sound", I hear a beep.