feat: reload theme/config on SIGUSR1 so external theme switchers can update a running instance
Is your feature request related to a problem? Please describe.
superfile reads its theme (and config) only once at startup. There is no way to make a running instance pick up a changed theme — no hotkey, no signal handler, no file watcher. In setups where the system theme changes at runtime (Omarchy, or any dark/light auto-switching setup), every open superfile instance keeps the old colors until it is closed and reopened.
For comparison, Omarchy's theme switcher already live-reloads other TUI tools simply by sending them a signal they implement:
- btop →
pkill -SIGUSR2 btop - helix →
pkill -USR1 helix - opencode →
killall -SIGUSR2 opencode
superfile is the one TUI in that set that can't be reloaded, so it stays out of sync.
Describe the solution you'd like
Handle a signal (e.g. SIGUSR1) that re-reads the theme file (theme/<name>.toml) and re-applies the styles on the running instance, without restarting or losing state (open panels, current directories, selection). Re-reading config.toml on the same signal would be a nice bonus but the theme alone would solve the problem.
Then a theme-switching script just needs pkill -USR1 spf, exactly like it already does for btop and helix.
Rough sketch in Go: a signal.Notify(ch, syscall.SIGUSR1) goroutine in main that sends a custom tea.Msg to the Bubble Tea program; the Update handler calls the existing theme loading (LoadThemeFile) and triggers a re-render. A Windows build would just skip the handler.
Describe alternatives you've considered
- A
reload_confighotkey would also work, but a signal is what external theme switchers can drive automatically. - A file watcher (fsnotify) on the theme file — works too, but it's heavier and more surprising than an explicit signal.
- Killing and relaunching
spffrom the theme hook — loses the current directories and panel state, so it's not really a substitute.
Additional context
- superfile v1.6.0 on Arch Linux / Omarchy.
- I'm already generating a superfile theme from Omarchy's palette on every theme change and pointing
theme = "omarchy"at it; the only missing piece is telling the running instance to pick it up. - Happy to test a PR.
Source: yorukot/superfile