hammerspoon2-docs
    Preparing search index...

    Variable onRelaunch

    onRelaunch: (() => void) | null

    Called when Hammerspoon 2 is launched again while it's already running (e.g. from Finder, Spotlight or open -a), or when its Dock icon is clicked, or null to remove it. It's only called when Settings → Advanced → "When launched while running" is set to "Call hs.onRelaunch". If it's set to that and no callback is set (for example because your config failed to load), the Console is shown instead, so you can always get back to it.