docs: add theme hot-reloading section with SIGUSR2 signal
Summary
Adds documentation for the undocumented theme hot-reloading feature using the SIGUSR2 signal.
This is useful for users who:
- Use dynamic theming tools like wallust or pywal
- Want to integrate OpenCode with wallpaper-based color schemes
- Need to test custom theme changes in real-time without restarting
Changes
- Added new "Theme hot-reloading" section to themes.mdx
- Documented the
SIGUSR2signal behavior - Added example integration with wallust
How I verified it works
Discovered this feature by reading the source code in packages/opencode/src/cli/cmd/tui/context/theme.tsx which contains:
process.on("SIGUSR2", async () => {
renderer.clearPaletteCache()
init()
})
Tested by sending pkill -USR2 -x opencode after modifying theme files - themes reload correctly.
The following comment was made by an LLM, it may be inaccurate:
Potential Duplicate Found
PR #4879: feat: add theme hot-reload functionality https://github.com/anomalyco/opencode/pull/4879
Reason for concern: This PR appears to implement the actual theme hot-reload feature that PR #9208 is documenting. The current PR (#9208) is adding documentation for a feature that was implemented in PR #4879. You may want to check if:
- PR #4879 already includes documentation of this feature
- These PRs should be coordinated to ensure documentation is complete when the feature is merged