An open API service indexing awesome lists of open source software.

https://github.com/faratech/htop-win

htop for Windows: inspired interactive process viewer for Windows, written in Rust
https://github.com/faratech/htop-win

bottom btm cli cross-platform htop monitoring process-monitor rust terminal top tui windows

Last synced: about 2 hours ago
JSON representation

htop for Windows: inspired interactive process viewer for Windows, written in Rust

Awesome Lists containing this project

README

          

# htop-win

**A native Windows clone of [htop](https://htop.dev/) - the beloved interactive process viewer, rebuilt from the ground up in Rust.**

[![GitHub release](https://img.shields.io/github/v/release/faratech/htop-win?style=flat-square)](https://github.com/faratech/htop-win/releases/latest)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
![Platform](https://img.shields.io/badge/platform-Windows%2010%2F11-0078D6?style=flat-square&logo=windows)
![Rust](https://img.shields.io/badge/rust-2024%20edition-orange?style=flat-square&logo=rust)
[![GitHub stars](https://img.shields.io/github/stars/faratech/htop-win?style=flat-square)](https://github.com/faratech/htop-win/stargazers)

> Inspired by the original [htop](https://github.com/htop-dev/htop) by Hisham Muhammad and contributors.


htop-win - Windows Process Viewer


htop-win demo

---

## Why htop-win?

Windows Task Manager is fine, but power users deserve better. **htop-win** brings the beloved Unix htop experience to Windows with:

- **Blazing fast performance** - Direct Windows API calls, no wrappers
- **Tiny footprint** - ~500KB binary with minimal dependencies
- **Full htop compatibility** - Same keyboard shortcuts you already know
- **Windows-native features** - Efficiency Mode, CPU affinity, elevation detection
- **GPU/NPU monitoring** - Task Manager parity via D3DKMT, auto-enabled when hardware exists
- **Automatic updates** - Background update checks with one-command upgrades

---

## Features

### Real-time System Monitoring
- Per-core CPU usage with color-coded gradient bars (green → yellow → red)
- Memory and swap usage visualization
- **GPU meter** - Total GPU utilization bar (shown automatically when a GPU is present)
- **NPU meter** - NPU utilization bar (shown automatically on Copilot+ and AI PC hardware)
- Network I/O rates (Rx/Tx)
- Disk I/O rates (read/write)
- Battery status and charge indicator
- System uptime and task/thread counts
- Configurable meter modes: Bar, Text, Graph, or Hidden
- Responsive header: scales gracefully from narrow to ultrawide terminals

### Interactive Process Management
- **27 sortable columns**: PID, CPU%, MEM%, GPU%, NPU%, I/O rate, TIME+, Command, and more
- **Screen tabs**: Switch between the Main view and the dedicated I/O tab
- **Tree view**: Visualize parent-child process relationships with collapsible branches
- **Search & Filter**: Find processes instantly with live search
- **Process tagging**: Select multiple processes for batch operations
- **Kill processes**: Graceful termination or force kill
- **Priority control**: Change process priority class (Idle → Realtime)
- **CPU affinity**: Pin processes to specific CPU cores

### GPU & NPU Monitoring (Task Manager Parity)
- System-wide GPU utilization meter in the header
- System-wide NPU utilization meter in the header (Copilot+ PCs)
- Per-process **GPU%** and **GPU-MEM** columns
- Per-process **NPU%** and **NPU-MEM** columns
- Uses the D3DKMT statistics DDI — the same source as Task Manager
- Automatically detected and enabled; hidden on machines without the hardware

### I/O Tab
A dedicated tab focused on disk I/O activity:
- **IO_RATE** - Combined read + write rate per process (bytes/sec)
- **IO_R/s** - Read rate
- **IO_W/s** - Write rate
- **HNDL** - Open handle count
- Sorted by I/O rate by default

### Windows-Specific Features
- **Efficiency Mode (EcoQoS)**: Reduce power consumption for background processes
- **Elevation detection**: See which processes run as Administrator
- **Architecture display**: Identify x86, x64, and ARM64 processes
- **Service account support**: View SYSTEM, LOCAL SERVICE, NETWORK SERVICE processes
- **Modified executable detection**: Highlight processes with changed/deleted binaries

### Full Mouse Support
- Click to select, double-click for details
- Right-click to tag processes
- Click column headers to sort
- Scroll wheel navigation
- Click meters to cycle display modes
- Click tabs to switch views

### Customization
- **8 color themes**: Default, Monochrome, Light Terminal, Midnight, Nord, and more
- **Configurable columns**: Show/hide and reorder any column, saved per-tab
- **Adjustable refresh rate**: 100ms to 5 seconds
- **Persistent settings**: Configuration saved to `%APPDATA%\htop-win\config`

---

## Installation

### Quick Install (Recommended)

Download the latest release for your architecture:

| Architecture | Download |
|--------------|----------|
| x64 (Intel/AMD) | [htop-win-amd64.exe](https://github.com/faratech/htop-win/releases/latest/download/htop-win-amd64.exe) |
| ARM64 | [htop-win-arm64.exe](https://github.com/faratech/htop-win/releases/latest/download/htop-win-arm64.exe) |

### Install to PATH

Run with administrator privileges to install globally:

```powershell
.\htop-win-amd64.exe --install
```

This installs to `%LOCALAPPDATA%\Microsoft\WindowsApps\htop.exe`, making `htop` available from any terminal.

### Update

Check for updates and install automatically:

```powershell
htop --update
```

Or force reinstall the current version:

```powershell
htop --update --force
```

### Build from Source

```powershell
# Clone the repository
git clone https://github.com/faratech/htop-win.git
cd htop-win

# Build optimized release (~500KB binary)
cargo build --release

# Run
.\target\release\htop-win.exe
```

**Requirements**: Rust 1.85+ (2024 edition), Windows 10/11

---

## Usage

```
htop-win [OPTIONS]

Options:
-d, --delay Refresh rate in milliseconds [default: 1500]
-u, --user Show only processes from this user
-p, --pid Show only these PIDs (comma-separated)
-s, --sort Sort by: pid, ppid, cpu, mem, time, command, user, threads
-t, --tree Start in tree view mode
-F, --filter Initial filter string
-H, --highlight Highlight new processes for N seconds
-n, --iterations Exit after N updates (for scripting)
--benchmark[=] Run N iterations and print timing stats [default: 20]
--benchmark-iterations
Run benchmark mode with N iterations
--inefficient Disable Efficiency Mode / EcoQoS
--no-color Monochrome mode
--no-mouse Disable mouse support
--no-meters Hide header meters
--readonly Disable kill/priority operations
--install Install to PATH (requires admin)
--update Check for and install updates
--gpu-debug Print GPU/NPU adapter diagnostics and exit
--cpu-debug Print CPU / processor-group diagnostics and exit
-f, --force Force install/update
-h, --help Show help
-V, --version Show version
```

### Examples

```powershell
# Monitor with 500ms refresh rate
htop -d 500

# Show only processes from current user
htop -u $env:USERNAME

# Start in tree view, sorted by memory
htop -t -s mem

# Filter to show only Chrome processes
htop -F chrome

# Monitor specific PIDs
htop -p 1234,5678,9012
```

---

## Keyboard Shortcuts

### Navigation

| Key | Action |
|-----|--------|
| `↑` / `k` | Move selection up |
| `↓` / `j` | Move selection down |
| `PgUp` / `PgDn` | Page up / down |
| `Home` / `g` | Jump to first process |
| `End` / `G` | Jump to last process |
| `Tab` / `Shift+Tab` | Switch screen tabs |
| `1` / `2` | PID prefix search |

### Main Controls (Function Keys)

| Key | Action |
|-----|--------|
| `F1` / `?` | Help screen |
| `F2` / `S` | Setup menu |
| `F3` / `/` | Search processes |
| `F4` / `\` | Filter processes |
| `F5` / `t` | Toggle tree view |
| `F6` / `<` `>` | Change sort column |
| `F7` / `]` | Raise priority (opens dialog one class higher, Enter to apply) |
| `F8` / `[` | Lower priority (opens dialog one class lower, Enter to apply) |
| `F9` | Kill process |
| `F10` / `q` | Quit |

### Process Operations

| Key | Action |
|-----|--------|
| `Enter` | View process details |
| `Space` | Tag/untag process |
| `c` | Tag process and all children |
| `U` | Untag all processes |
| `Ctrl+T` | Tag all with same name |
| `Ctrl+A` | Toggle tag all visible |
| `e` | View environment variables |
| `w` | View full command line |
| `a` | Set CPU affinity |
| `F` | Toggle follow mode |

### Tree View

| Key | Action |
|-----|--------|
| `+` / `=` | Expand branch |
| `-` | Collapse branch |
| `*` | Toggle expand/collapse all |
| `Backspace` | Collapse to parent |

### Display

| Key | Action |
|-----|--------|
| `#` | Toggle header meters |
| `p` | Toggle program path display |
| `H` | Toggle user threads |
| `K` | Toggle kernel threads |
| `Z` | Pause/resume updates |
| `I` | Invert sort order |

### Quick Sort

| Key | Sort By |
|-----|---------|
| `P` | CPU% |
| `M` | Memory% |
| `T` | Time |
| `N` | PID |

---

## Configuration

htop-win saves settings to `%APPDATA%\htop-win\config\config.json`. Configure via the Setup menu (`F2`) or edit directly:

```json
{
"refresh_rate_ms": 1500,
"tree_view_default": false,
"color_scheme": "Default",
"show_kernel_threads": false,
"show_program_path": false,
"highlight_new_processes": true,
"highlight_large_numbers": true,
"cpu_meter_mode": "Bar",
"memory_meter_mode": "Bar",
"visible_columns": ["PID", "USER", "PRI", "CLASS", "THR", "VIRT", "RES", "SHR", "S", "CPU%", "MEM%", "TIME+", "Command"],
"mouse_enabled": true,
"confirm_kill": true
}
```

### Color Themes

Access via Setup (`F2`) → Color Scheme:

- **Default** - Classic htop colors
- **Monochrome** - No colors (accessibility)
- **Black on White** - Light theme
- **Light Terminal** - For light backgrounds
- **Midnight** - Dark blue theme
- **Blacknight** - Pure dark theme
- **Broken Gray** - Subtle grays
- **Nord** - Nord color palette

---

## Columns Reference

### Main Tab

| Column | Description | Width |
|--------|-------------|-------|
| `PID` | Process ID | 7 |
| `PPID` | Parent Process ID | 7 |
| `USER` | Process owner | 10 |
| `PRI` | Priority (0-31) | 4 |
| `CLASS` | Priority class (Idle/Normal/High/Realtime) | 7 |
| `THR` | Thread count | 4 |
| `VIRT` | Virtual memory | 8 |
| `RES` | Resident (physical) memory | 8 |
| `SHR` | Shared memory | 8 |
| `S` | Status if known; `?` when Windows native process query does not expose htop-style state | 3 |
| `CPU%` | CPU usage percentage | 6 |
| `MEM%` | Memory usage percentage | 6 |
| `GPU%` | GPU utilization % (max across all GPU engines) | 6 |
| `GPU-MEM` | GPU committed memory across all adapters | 8 |
| `NPU%` | NPU utilization % | 6 |
| `NPU-MEM` | NPU dedicated + shared memory | 8 |
| `TIME+` | Cumulative CPU time | 10 |
| `START` | Process start time | 8 |
| `Command` | Command line | Flexible |
| `ELEV` | Elevated/Admin status | 4 |
| `ARCH` | Architecture (x86/x64/ARM64) | 5 |
| `ECO` | Efficiency Mode status | 4 |

> New default configs include GPU% / GPU-MEM and NPU% / NPU-MEM when relevant hardware is detected. Existing custom column layouts are preserved; enable these columns from Setup if you want to add them later.

### I/O Tab

| Column | Description |
|--------|-------------|
| `PID` | Process ID |
| `USER` | Process owner |
| `IO_RATE` | Combined read + write rate (bytes/sec) |
| `IO_R/s` | Read rate |
| `IO_W/s` | Write rate |
| `IO_RD` | Cumulative bytes read |
| `IO_WR` | Cumulative bytes written |
| `HNDL` | Open handle count |
| `Command` | Command line |

---

## System Requirements

- **OS**: Windows 10 (1903+) or Windows 11
- **Architecture**: x64 (AMD64) or ARM64
- **Terminal**: Windows Terminal recommended (supports full color and Unicode)
- **Privileges**: Administrator recommended for full process visibility

---

## Dependencies

Minimal dependency set optimized for small binary size:

| Dependency | Purpose |
|------------|---------|
| [crossterm](https://github.com/crossterm-rs/crossterm) | Cross-platform terminal I/O |
| [windows-rs](https://github.com/microsoft/windows-rs) | Native Windows API bindings |
| [unicode-width](https://github.com/unicode-rs/unicode-width) | Unicode character width calculation |
| [bitflags](https://github.com/bitflags/bitflags) | Terminal modifier flags |
| [lexopt](https://github.com/blyber/lexopt) | Lightweight argument parsing |

**No heavy frameworks**: Custom terminal UI library (replaces ratatui), custom JSON parser (replaces serde).

---

## Performance

htop-win is designed for efficiency:

- **~500KB binary** - Minimal dependencies, LTO optimization
- **Efficiency Mode by default** - Runs with reduced CPU priority
- **Smart caching** - Minimizes Windows API calls
- **Background data collection** - System metrics refresh off the UI thread
- **Diff-based rendering** - Only updates changed terminal cells
- **Direct API access** - No abstraction layers

---

## Comparison with Alternatives

| Feature | htop-win | Task Manager | Process Explorer |
|---------|----------|--------------|------------------|
| Terminal-based | Yes | No | No |
| Keyboard-driven | Yes | Limited | Limited |
| Tree view | Yes | Yes | Yes |
| Process search | Yes | Yes | Yes |
| CPU affinity | Yes | Yes | Yes |
| GPU/NPU monitoring | Yes | Yes | No |
| Efficiency Mode | Yes | Yes | No |
| I/O per-process | Yes | No | Yes |
| Custom columns | Yes | Limited | Yes |
| Color themes | 8 themes | No | No |
| Binary size | ~500KB | N/A | ~2MB |
| Auto-update | Yes | N/A | No |

---

## Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

---

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

## Acknowledgments

- [htop](https://github.com/htop-dev/htop) - The original inspiration by Hisham Muhammad
- [windows-rs](https://github.com/microsoft/windows-rs) - Excellent Windows API bindings
- [crossterm](https://github.com/crossterm-rs/crossterm) - Cross-platform terminal library

---


Star this repo if you find it useful!

https://github.com/faratech/htop-win