~/.hammerspoon/init.lua:hs.hotkey.bind({"⌘", "⇧"}, "1", function()
hs.dialog.blockAlert("I’m going to", "crash…")
end)
hs.hotkey.bind({"⌘", "⇧"}, "2", function() hs.reload() end)
Reload the Hammerspoon configuration.
Press ⌘⇧1 to show the blockAlert. Don’t press OK.
Press ⌘⇧2 to reload the Hammerspoon configuration.
Press OK on the blockAlert.
Hammerspoon crashes.
I think this has to do with the blockAlert being garbage collected when the configuration is reloaded.
Looks like we'll need to store the model NSAlert as a global variable so we can dismiss it when the module runs __gc
Not related, but "TIL" you could use the modifier key symbols in your keybinds like that!
hs.hotkey.bind({"⌘", "⇧"}...
Most helpful comment
Looks like we'll need to store the model NSAlert as a global variable so we can dismiss it when the module runs
__gc