Skip to content

Support Windows htop fallback#19

Merged
VectoDE merged 2 commits intomainfrom
codex/implement-htop-command-for-windows-and-linux
Oct 22, 2025
Merged

Support Windows htop fallback#19
VectoDE merged 2 commits intomainfrom
codex/implement-htop-command-for-windows-and-linux

Conversation

@VectoDE
Copy link
Owner

@VectoDE VectoDE commented Oct 22, 2025

Summary

  • add Windows-specific handling for the htop command, including a PowerShell fallback when the binary is unavailable
  • share the theme setup helper across platforms so native htop installs still use the ServerCommander colors
  • document the new Windows behaviour in the README and usage guide

Testing

  • go test ./... (fails: command hung in container environment)

https://chatgpt.com/codex/tasks/task_e_68f8fc09fd20832cada49dcc4efaeccc

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

src/cmd/htop.go Outdated
Comment on lines +103 to +108
fmt.Printf("%sLaunching PowerShell process monitor (htop not found). Use Space/PageUp/PageDown to navigate and Ctrl+C to exit.%s\n", utils.Green, utils.Reset)

script := strings.Join([]string{
"$ErrorActionPreference = 'Stop'",
"Write-Host 'Process list sorted by CPU usage. Press Ctrl+C to exit paging.'",
"Get-Process | Sort-Object -Property CPU -Descending | Select-Object -Property Id, ProcessName, CPU, PM, WS, StartTime -ErrorAction SilentlyContinue | Format-Table -AutoSize | Out-Host -Paging",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid recommending Ctrl+C for PowerShell fallback

The PowerShell fallback prints instructions to exit with Ctrl+C, but the command handler does not install a signal handler or otherwise suppress SIGINT. On Windows, pressing Ctrl+C terminates the ServerCommander process itself, not just the PowerShell pager, so users who follow the prompt lose their entire session instead of returning to the console. The prompt (and docs) should suggest a non-destructive key such as q, or the implementation should trap SIGINT so the parent process survives.

Useful? React with 👍 / 👎.

@VectoDE VectoDE merged commit 7e6c997 into main Oct 22, 2025
1 check failed
@VectoDE VectoDE deleted the codex/implement-htop-command-for-windows-and-linux branch October 22, 2025 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant