Automatically trigger VSCode commands when terminal commands are executed.
Perfect for solving the clangd + xmake C++ modules issue:
clangdmemory-mapsstd.pcmfor language supportclangcompiler cannot accessstd.pcmwhen it's memory-mapped- This extension auto-restarts
clangdbefore builds to release the file lock
- 🔍 Auto-detect terminal commands via Shell Integration
- ⚡ Trigger any VSCode command based on regex patterns
- 📊 Visual feedback via temporary status bar notifications
- 🛡️ Smart detection warns if Shell Integration is unavailable
Go to Settings → Extensions → Terminal Command Trigger
Actions support two formats:
{
"onStart": "clangd.restart"
}{
"onStart": "ext:extensionId:api.path"
}Example:
{
"onStart": "ext:llvm-vs-code-extensions.vscode-clangd:client.stop"
}This calls api.client.stop() on the clangd extension.
{
"terminalCommandTrigger.triggers": [
{
"pattern": "^xmake\\b",
"onStart": "ext:llvm-vs-code-extensions.vscode-clangd:client.stop",
"onEnd": "ext:llvm-vs-code-extensions.vscode-clangd:client.start",
"description": "Stop clangd before xmake build, restart after"
}
]
}How it works:
- You run
xmake buildin terminal - Extension detects it and calls
client.stop()→ releases std.pcm lock - xmake compiles successfully
- Extension calls
client.start()→ clangd resumes language support
- VSCode 1.88+ (Shell Integration API)
- Supported shells: PowerShell, bash, zsh, fish
- The extension will warn you once if Shell Integration is not available
Make sure you're using a supported shell:
- Windows: PowerShell (not cmd.exe)
- macOS/Linux: bash, zsh, or fish
See VSCode Shell Integration docs
- Check your regex pattern in settings
- Open Output → Terminal Command Trigger for debug logs
- Verify the target command exists (e.g.,
clangd.restartrequires clangd extension)
MIT
Inspired by the real-world pain of C++ modules + clangd development.