Sloth
Sloth

Reputation: 71

How to make VSCode produce beep sound while outputting the BELL character '\a'?

The operating system is Ubuntu20.04. I used echo -e '\a' on the system terminal and the beep sound did play. So it has nothing to do with the device or the system settings.

When I ran the following code on VSCode,

#include <iostream>
using namespace std;
int main()
{
    cout<<'\a';
    cout<<endl;
    return 0;
}

no sound was produced. When I used the TERMINAL to display the output, it showed up as a visual bell next to the terminal's name. And when I used the OUTPUT instead, a tiny red-background icon with white text "BEL" was output. red icon

Or maybe there is something wrong with the configuration of my VSCode?

Upvotes: 7

Views: 3421

Answers (2)

rrob
rrob

Reputation: 407

Enable with:

"terminal.integrated.enableBell": true

UPDATE 13.10.2024 enableBell is deprecated and you can use:

"terminal.integrated.enableVisualBell": true,
"accessibility.signals.terminalBell":{
  "sound": "on",
  "announcement": "auto"
},

Use the Settings UI: F1 -> Preferences: Open Settings (UI) -> Search for "Bell"

Upvotes: 4

Mark
Mark

Reputation: 180845

I think this will be fixed in vscode v1.72. An audio cue has been added for the terminal bell (see https://github.com/microsoft/vscode/commit/001f7d5b4c20220ef7294f18616ad52df1039048).

With an associated setting, search for Audio Cues to enable.

Upvotes: 2

Related Questions