opencode
opencode copied to clipboard
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.