One command to install. Keyboard shortcuts ready. Zero config.
Installation · Commands · Monitor · Recovery · Doctor
dotnet tool install -g TerminalStateGuard
tsg installDone. Reopen your terminal — shortcuts and integration are active.
| Platform | Action |
|---|---|
| Windows | Installs Windows Terminal Fragment for native shortcut integration |
| Windows | Configures PSReadLine keyboard shortcuts in PowerShell profile |
| Linux | Adds shell aliases and keybindings to .bashrc/.zshrc |
| Both | Deploys monitoring scripts to ~/.tsg/ |
tsg install # Setup scripts, shortcuts & terminal integration
tsg boost # ⚡ Elevate Copilot process priority (Admin/sudo)
tsg monitor # 📊 Safe live monitor with diagnostics
tsg status # 📋 Quick health check
tsg recover # 🔄 Recover terminal tabs + Copilot sessions
tsg restore # 🔄 Revert all priority changes
tsg doctor # 🩺 Diagnose environment issues
tsg uninstall # 🗑️ Remove configuration| Shortcut | Action |
|---|---|
Ctrl+Alt+B |
Boost |
Ctrl+Alt+M |
Monitor |
Ctrl+Alt+S |
Status |
Ctrl+Alt+F |
Recover |
Ctrl+Alt+R |
Restore |
100% read-only — never modifies Copilot's internal files.
⚡ TSG MONITOR 06:30:00 [🟢 BOOSTED] [4/4]
══════════════════════════════════════════════════════
PID 221120 | copilot | 180 MB | H: 234 | Δ 0.3s | 🟢 IDLE
📂 MyProject — Implement auth system
📄 Events: 2.1MB | Last: assistant.turn_end | ok
PID 52300 | copilot-ls | 16 MB | H: 120 | Δ 0.0s | 🟢 IDLE
🟣 Visual Studio
══════════════════════════════════════════════════════
TOTAL: 196 MB | CPU: 125.3s | Threads: 31
| State | Meaning | Action |
|---|---|---|
| 🟢 IDLE | Healthy, idle | None |
| 🟡 ACTIVE | Processing | Wait |
| 🔴 HIGH CPU | Heavy computation | Wait or close → resume |
| 🔴 HANDLE LEAK | events.jsonl too large | Close tab → copilot --resume |
| ❄️ STUCK | Turn never completed | Close tab → resume (auto-recovers) |
tsg recoverScans Windows Terminal state + Copilot sessions and reopens tabs with copilot --resume:
🔄 Session Recovery
✅ 8 tabs (5 copilot)
[1] 🤖 MyProject (Win 1)
💬 Implement auth system
[2] 📂 Documents (Win 1)
[3] 🤖 WebApp (Win 2)
💬 Fix DllNotFoundException
tsg doctorChecks environment, finds stuck sessions, validates setup:
🩺 TSG Doctor — Environment Check
✅ .NET 10.0.0
✅ Shell: C:\Program Files\PowerShell\7\pwsh.exe
✅ TSG dir: C:\Users\you\.tsg
✅ Copilot sessions: 12
⚠️ 1 session(s) > 20MB — may cause slowness
✅ Windows Terminal Fragment installed
✅ Terminal state: 2 windows, 8 tabs
🎉 All checks passed!
TSG never modifies Copilot's internal files.
- ✅ All monitoring is read-only — only reads metadata
- ✅ Never deletes, trims, or edits
events.jsonl - ✅ Session recovery uses native
copilot --resume - ✅ Diagnostics show root cause + safe manual recommendations
tsg (dotnet tool)
├── Platform/
│ ├── IPlatformHost.cs — Cross-platform abstraction
│ ├── WindowsHost.cs — Windows Terminal Fragment + PSReadLine
│ └── LinuxHost.cs — bash/zsh aliases + keybindings
├── Scripts/
│ ├── windows/*.ps1 — PowerShell monitoring scripts
│ └── linux/*.sh — Bash monitoring scripts
├── CommandRegistry.cs — Lambda-based command routing
├── Installer.cs — Script deployment + profile config
├── ScriptRunner.cs — Cross-platform script execution
└── Diagnostics.cs — Environment health checks
Built with: .NET 10 · C# 14 · Windows Terminal Fragments API
| Platform | Requirements |
|---|---|
| Windows | Windows Terminal, PowerShell 7+, .NET 10 Runtime |
| Linux | bash/zsh, .NET 10 Runtime |
| Both | GitHub Copilot CLI (npm i -g @github/copilot) |
tsg uninstall
dotnet tool uninstall -g TerminalStateGuard