A powerful VS Code extension that automatically captures output from all your terminals and displays them in a beautiful, CloudWatch-style webview panel with advanced filtering, search, and real-time updates.
CloudWatch-style log viewer with multi-terminal tabs, search, filtering, and smart error/warning detection
- Zero configuration required - automatically captures ALL terminals
- Works with integrated terminals, task runners, and debug consoles
- Starts capturing as soon as VS Code opens
- Historical logs preserved - see logs even if you open the panel later
- Collapsible log entries with timestamp and preview
- Each log shows date/time and truncated preview
- Expand to see full multi-line output
- Clean, organized view similar to AWS CloudWatch
- Commands (green with
$prefix) - Your typed commands - Errors (red with
βprefix) - Errors, exceptions, failures - Warnings (orange with
βprefix) - Warnings, deprecations - Normal output (default) - Regular terminal output
Detects 15+ error patterns and 5+ warning patterns automatically!
- Real-time search - Find text across all logs instantly
- Type filters - Show only errors, warnings, commands, or normal logs
- Combined filtering - Search AND filter simultaneously
- Filters persist when switching between terminals
- Tab interface - One tab per terminal
- Switch between terminals seamlessly
- Auto-detects terminal names
- Close terminals removes their tabs
- Keyboard shortcut:
cmd+shift+l(Mac) orctrl+shift+l(Windows/Linux) - Command palette: "Better Terminal Logs: Show Better Logs"
- Instant activation with notification on startup
- Automatically removes ANSI escape codes
- Filters out shell prompt artifacts (
%from zsh) - Removes terminal control sequences
- Clean, readable logs
- Open VS Code
- Go to Extensions (
cmd+shift+xorctrl+shift+x) - Search for "Better Terminal Logs"
- Click Install
- Extension activates automatically!
Or install from command line:
code --install-extension dmytro-ivashchuk.better-terminal-logsNote: The extension activates automatically when VS Code starts - no configuration needed!
- Open any terminal in VS Code - it's automatically captured
- Press
cmd+shift+l(Mac) orctrl+shift+l(Windows/Linux) to view logs - Use search and filters to find what you need
That's it! The extension works out of the box.
Open the panel:
- Press
cmd+shift+l(Mac) orctrl+shift+l(Windows/Linux) - Or: Command Palette β "Better Terminal Logs: Show Better Logs"
Switch terminals:
- Click terminal tabs at the top
Filter logs:
- Use the dropdown: All / Errors / Warnings / Normal / Commands
Search logs:
- Type in the search box for real-time filtering
Clear logs:
- Click "Clear" button to clear current terminal's logs
# Run commands in any terminal
$ npm install
$ npm start
$ node app.js
Error: Cannot find module 'express'In Better Logs panel, you'll see:
$ npm install β Green (command)
added 150 packages... β Normal
$ npm start β Green (command)
β Warning: deprecated... β Orange (warning)
Server running... β Normal
$ node app.js β Green (command)
β Error: Cannot find... β Red (error)
-
Terminal Detection (
onDidOpenTerminal)- Registers all terminals when created
- Assigns unique ID and name to each
-
Shell Integration API (
onDidStartTerminalShellExecution)- Captures commands and their output
- Works with terminals that have shell integration enabled
- Provides structured data (command vs output)
-
Log Processing Pipeline
Raw Terminal Data β Remove ANSI codes & control sequences β Filter shell prompt artifacts (%) β Detect log type (error/warning/command/normal) β Store in memory (terminalLogs map) β Send to webview (if panel open) β Display with search/filter applied -
Historical Replay
- Logs stored in memory even when panel closed
- When panel opens, all stored logs replayed
- Full history available immediately
| Command | Keyboard Shortcut | Description |
|---|---|---|
better-terminal-logs.showBetterLogs |
cmd+shift+l (Mac)ctrl+shift+l (Win/Linux) |
Opens the Better Terminal Logs panel |
Detects: error, failed, failure, exception, fatal, cannot, unable to, not found, invalid, denied, refused, exit code [1-9], stack traces (at Module...), [ERROR], ERR!, β, β, β¨―
Detects: warn, warning, caution, deprecated, [WARN], β
All commands captured from shell execution
Everything else
- TypeScript - Extension logic
- VS Code Extension API - Shell Integration, Webview, Commands
- VS Code Shell Integration API - Terminal output capture (v1.93+)
- HTML/CSS/JavaScript - Webview UI (
src/webview/index.html) - VS Code Theme Variables - Native theming support
Currently, the extension works out-of-the-box with no configuration needed. Future versions may add settings for:
- Maximum log history size
- Custom log patterns
- Auto-clear on terminal close
- Log export format
Issue: When you run npm scripts by hovering over package.json and clicking "Run Script", logs may not capture properly.
Reason: VS Code creates these terminals without shell integration enabled, so the onDidStartTerminalShellExecution API doesn't fire.
Workaround: Run npm scripts manually in the terminal:
npm run startStatus: Investigating alternative capture methods for these terminals.
The extension relies on VS Code's Shell Integration API (introduced in v1.93). Ensure:
- You're using VS Code 1.93 or later
- Shell integration is not disabled in settings
- Your shell supports integration (bash, zsh, fish, pwsh)
All logs are stored in memory. For long-running terminals with massive output, consider clearing logs periodically using the "Clear" button.
-
Clone the repository:
git clone https://github.com/DimaIvashchuk/better-terminal-logs-vscode-extension.git cd better-terminal-logs-vscode-extension -
Install dependencies:
npm install
-
Open in VS Code:
code . -
Run the extension:
- Press
F5to open Extension Development Host - Test your changes in the new window
- Press
-
Make changes:
- Edit
src/extension.tsfor backend logic - Edit
src/webview/index.htmlfor UI - Run
npm run compileto compile TypeScript
- Edit
better-terminal-logs-vscode-extension/
βββ src/
β βββ extension.ts # Main extension logic
β βββ webview/
β βββ index.html # Webview UI
βββ out/ # Compiled JavaScript
βββ package.json # Extension manifest
βββ tsconfig.json # TypeScript config
βββ README.md
src/extension.ts
- Terminal registration and capture
- Log processing and cleaning
- Shell Integration API listeners
- Webview panel management
src/webview/index.html
- Tab management
- Log rendering (CloudWatch style)
- Search and filter UI
- Real-time updates via
postMessage
Run npm scripts in the integrated terminal and verify:
- β Logs appear in Better Logs panel
- β
Commands shown in green with
$prefix - β
Errors shown in red with
βprefix - β Search filters logs in real-time
- β Type filter works correctly
- β Logs persist when panel closed/reopened
Contributions are welcome! To contribute:
- Fork the repository on GitHub
- Clone your fork and set up the development environment (see Development Setup)
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes and test thoroughly
- Commit your changes:
git commit -m 'Add amazing feature' - Push to your fork:
git push origin feature/amazing-feature
- Open a Pull Request on GitHub
- Follow the existing code style (TypeScript, ESLint)
- Test your changes in Extension Development Host (
F5) - Update documentation if adding new features
- Add your changes to
CHANGELOG.md - Keep commits focused and descriptive
MIT
- VS Code Extension API documentation
- Shell Integration API (VS Code 1.93+)
- AWS CloudWatch UI inspiration
Enjoy cleaner, more organized terminal logs! π
Made with β€οΈ for developers who love clean terminals
