Terminal Error Sound Alert (VS Code Extension)
Plays a random custom sound when a terminal command fails (non-zero exit code).
Setup
- Put any number of audio files in this extension folder:
- Supported extensions:
.wav, .mp3, .ogg, .m4a, .flac, .aac
- (Optional) Add extra absolute paths in setting
terminalErrorSoundAlert.audioFilePaths.
- (Optional) Run command:
Terminal Error Sound Alert: Test Sound.
How detection works
The extension can trigger on:
- Non-zero terminal shell exit code when
terminalErrorSoundAlert.useShellExitCode is enabled.
- Sound is picked randomly from all available audio files.
Settings
terminalErrorSoundAlert.audioFilePaths: optional list of extra absolute audio file paths.
terminalErrorSoundAlert.audioFilePath: deprecated single-file fallback.
terminalErrorSoundAlert.debounceMs: cooldown between sounds.
terminalErrorSoundAlert.useShellExitCode: trigger on non-zero command exit.
Local test
- Open this folder in VS Code.
- Press
F5 to launch an Extension Development Host.
- Make sure audio files exist under
audio/.
- Open terminal in that window and run a failing command like
ls /path/that/does/not/exist.
- You can also run command:
Terminal Error Sound Alert: Test Sound.
- Optional packaged test:
npm run package
- VS Code -> Extensions view ->
... menu -> Install from VSIX...
- Select
terminal-error-sound-alert-0.0.2.vsix
Publish to VS Code Marketplace
- Create a publisher in Visual Studio Marketplace.
- Replace
"publisher": "local" in package.json with your publisher ID.
- Create a Personal Access Token (PAT) for Marketplace publishing.
- In this project:
npm install
npx @vscode/vsce login <your-publisher-id>
npm run package (creates a .vsix for local install/share)
npm run publish
Notes
- Linux playback tries
paplay, then aplay, then ffplay.
- macOS playback uses
afplay.
- Windows playback uses PowerShell SoundPlayer.
| |