Port Killer VS Code Extension
A simple and intuitive VS Code extension that allows you to kill processes running on specific ports directly from the status bar.
Features
- ⚡ Simple Status Bar UI: Click the lightning bolt icon in the status bar to kill a port
- 🔍 Port Scanning: Discover all active ports and running processes
- 📋 Overlay Port Selection: View ports in a modern overlay panel with interactive selection
- 🔫 Smart Batch Killing: Kill selected ports or all ports with confirmation dialogs
- ✅ Selective Operations: Choose exactly which ports to kill instead of all-or-nothing
- ✅ Input Validation: Ensures you enter a valid port number (1-65535)
- 🌐 Cross-Platform Support: Works on macOS, Linux, and Windows
- 📢 User-Friendly Feedback: Shows progress notifications and success/error messages
- 🎯 Command Palette Integration: Access all features via VS Code command palette
- 🔄 Process Information: View detailed process names, PIDs, and commands
Installation
- Download the
.vsix file from the releases
- In VS Code, go to Extensions → Install from VSIX...
- Select the downloaded file
- Reload VS Code
Usage
Method 1: Quick Port Killing (Status Bar)
- Look for the ⚡ "Port Killer" icon in the bottom status bar
- Click on it
- Enter the port number you want to kill (e.g., 4000)
- Press Enter
Method 2: Port Scanning & Discovery (Status Bar)
- Look for the 🔍 "Scan Ports" icon next to the Port Killer icon
- Click on it to scan all active ports
- Choose from options:
- Kill All Ports: Batch kill all active ports
- Scan Again: Refresh the port list
- Close: Dismiss the dialog
Method 3: Command Palette
- Press
Ctrl+Shift+P (or Cmd+Shift+P on Mac)
- Type "Port Killer" to see all available commands:
- Kill Port: Enter a specific port number
- Scan Active Ports: Interactive port selection
- Show Active Ports: View all ports with batch options
Method 4: Advanced Port Scanning (Command Palette)
Scan Active Ports
- Use "Port Killer: Scan Active Ports" command
- Select from the interactive list showing:
- Port number
- Process name and PID
- Full command details
- Choose a port to kill directly from the list
View All Active Ports
- Use "Port Killer: Show Active Ports" command
- See an overlay panel with all active ports and interactive selection
- Features:
- Visual Selection: Click ports to toggle checkboxes (☐/☑) with hover effects
- Smart Kill Button: Shows "Kill All Ports" initially, changes to "Kill Selected Ports" with count when selections are made
- Batch Operations: Kill only selected ports or all ports when none selected
- Real-time Updates: Live count of selected ports and visual feedback
- Modern UI: Clean, responsive design that matches VS Code theme
- Scan Again: Refresh the port list at any time
How it Works
The extension uses system commands to find and terminate processes:
- macOS/Linux: Uses
lsof to find processes and kill to terminate them
- Windows: Uses
netstat to find processes and taskkill to terminate them
Requirements
- VS Code 1.74.0 or higher
- Administrative privileges may be required for killing certain processes
| |