A lightweight Visual Studio Code extension that enhances your coding experience by playing custom audio alerts for various terminal and testing events. Never miss a failed build or a completed long-running task again!
This extension monitors your VS Code environment and can play specific audio .wav files based on the following triggers:
- Terminal Open: Plays a sound when a new integrated terminal session is started.
- Terminal Close: Plays a sound when an integrated terminal session ends.
- Command/Task Success: Plays a sound when a terminal shell command (like
npm run buildornpm test) or a defined Task watcher successfully completes with an exit code of0. - Command/Task Error: Plays a warning sound when a terminal command or a defined Task fails with a non-zero exit code.
Note: Audio playback is completely native and relies on the OS (
powershellon Windows,afplayon macOS,aplay/paplayon Linux). There are no heavy third-party audio dependencies!
This extension contributes the following settings that can be customized in your VS Code settings under Audio Alerts:
audioAlerts.enabled: Enable/disable this extension entirely. (Default:true)audioAlerts.playOn.success: Play thesuccess.wavsound on command/task success. (Default:true)audioAlerts.playOn.error: Play theerror.wavsound on command/task error. (Default:true)audioAlerts.playOn.terminalOpen: Play theterminal-open.wavsound when a terminal starts. (Default:false)audioAlerts.playOn.terminalClose: Play theterminal-close.wavsound when a terminal closes. (Default:false)
If you're cloning this repository and want to hack on it locally or update the project context:
- Install Dependencies: Run
npm installto grab the TypeScript definitions and compiler dependencies. - Compile the Extension: Run
npm run compileto build the TypeScript files into theout/directory, or usenpm run watchto recompile automatically on save. - Audio Configuration: The actual
.wavfiles need to be placed inside theassets/directory at the root of the project.assets/success.wavassets/error.wavassets/terminal-open.wavassets/terminal-close.wav
- Testing Locally: Press
F5in VS Code to launch the Extension Development Host window with the extension loaded.
To share this extension with others or install it manually via .vsix:
- Ensure you have
vsceinstalled globally:npm install -g @vscode/vsce. - Run
vsce packagein the repository root. - A
.vsixfile will be generated. You can install this file in VS Code by navigating to the Extensions view ->...context menu ->Install from VSIX....