Never miss a terminal error again!
Terminal Police is a Visual Studio Code extension that plays an instant audio alert whenever your terminal commands fail or errors appear. Whether it's a build failure, runtime exception, or syntax error—you'll know immediately.
Perfect for developers who multitask, run long builds, or want instant feedback without constantly watching the terminal.
- 🚨 Automatic Error Detection — Monitors terminal output in real-time and catches failures instantly
- 🔊 Custom Sound Support — Use any
.mp3or.wavfile as your alert sound - 🎵 Built-in Default Sound — Works out of the box with a bundled alert sound
- ⚡ Smart Debouncing — Prevents sound spam with configurable cooldown
- 🎯 Command Palette Integration — Toggle on/off or test sounds with one command
- 🌍 Cross-Platform — Windows, macOS, and Linux support
- 🎨 Works with Colored Output — ANSI escape codes automatically handled
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X/Cmd+Shift+X) - Search for "Terminal Police"
- Click Install
- Download the latest
.vsixfrom Releases - In VS Code: Extensions → ⋯ → Install from VSIX…
- Select the downloaded file
- Install the extension (see above)
- Run any terminal command that produces an error
- Hear the alert sound instantly when errors are detected!
Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and run:
Terminal Police: Test Sound
Customize Terminal Police in your VS Code settings:
| Setting | Type | Default | Description |
|---|---|---|---|
terminalErrorSound.enabled |
boolean | true |
Turn Terminal Police on or off |
terminalErrorSound.soundFile |
string | "" |
Path to custom sound file (empty = use default) |
terminalErrorSound.debounceDuration |
number | 3000 |
Cooldown (ms) between consecutive alerts |
Access these commands from the Command Palette (Ctrl+Shift+P / Cmd+Shift+P):
| Command | Description |
|---|---|
Terminal Police: Toggle Enable/Disable |
Quickly turn the extension on or off |
Terminal Police: Test Sound |
Play a test sound to verify configuration |
Terminal Police automatically detects these common error patterns (case-insensitive):
| Pattern | Example |
|---|---|
error |
error: something went wrong |
Error: |
Error: ENOENT |
Traceback |
Traceback (most recent call last): |
Exception |
NullPointerException |
failed |
Build failed |
command not found |
bash: foo: command not found |
ModuleNotFoundError |
ModuleNotFoundError: No module named x |
SyntaxError |
SyntaxError: Unexpected token |
TypeError |
TypeError: undefined is not a function |
ReferenceError |
ReferenceError: x is not defined |
FATAL |
FATAL ERROR: heap out of memory |
ERR! |
npm ERR! code ELIFECYCLE |
The extension strips ANSI escape codes before pattern matching, so colored terminal output won't interfere with detection.
Want your own alert sound? It's easy:
-
Choose a sound file (
.mp3or.wavformat) -
Open VS Code Settings (
Ctrl+,/Cmd+,) -
Search for
Terminal Police -
Set the path in
terminalErrorSound.soundFile:"terminalErrorSound.soundFile": "C:\\path\\to\\your\\sound.mp3"
-
Test it with
Terminal Police: Test Soundcommand
The extension loads your custom sound immediately—no reload required!
- Activation: Terminal Police starts automatically when VS Code launches
- Monitoring: Listens to
vscode.window.onDidEndTerminalShellExecutionevents - Detection: Checks if terminal commands exit with non-zero exit codes (errors)
- Playback: Plays the configured sound using native OS audio commands:
- Windows: PowerShell
SoundPlayer(.wav) orMediaPlayer(.mp3) - macOS:
afplaycommand-line tool (built-in) - Linux:
aplay,mpv,ffplay, orpaplay(auto-detected)
- Windows: PowerShell
- Debouncing: Enforces cooldown period to prevent sound spam
- VS Code 1.93.0 or later
- Audio playback support:
- Windows: PowerShell (built-in) ✅
- macOS:
afplay(built-in) ✅ - Linux: One of
aplay,mpv,ffplay, orpaplay(usually pre-installed)
Contributions are welcome! If you'd like to improve Terminal Police:
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -m "Add some feature" - Push to the branch:
git push origin feature/my-feature - Open a Pull Request
Found a bug or have a feature request?
- Report issues: GitHub Issues
- Questions? Open a discussion on GitHub
Terminal-Police/
├── package.json # Extension manifest and metadata
├── tsconfig.json # TypeScript configuration
├── src/
│ └── extension.ts # Main extension logic
├── media/
│ └── error.wav # Default alert sound (bundled)
├── image/
│ └── icon.png # Extension icon
├── out/ # Compiled output (generated)
│ └── extension.js
└── README.md # This file
MIT License - see LICENSE for details
If Terminal Police helps you catch errors faster, please:
- ⭐ Star the repo on GitHub
- 📝 Rate the extension on the VS Code Marketplace
- 🐦 Share it with other developers
Made with ❤️ by CodeWhizPuneet
{ // Enable or disable Terminal Police "terminalErrorSound.enabled": true, // Path to your custom alert sound (mp3 or wav) // Leave empty to use the default bundled sound "terminalErrorSound.soundFile": "", // Minimum time (ms) between alerts to prevent spam "terminalErrorSound.debounceDuration": 3000 }