Skip to content

hs.spaces.removeSpace fails #3644

@acheronfail

Description

@acheronfail

I've noticed that hs.spaces.removeSpace doesn't work for me, some details:

  • macOS 14.5
  • Hammerspoon 0.9.100

Here's an easy way to reproduce the error:

-- this is run directly in the hammerspoon console (ensure you have more than one space):
> for _, spaces in pairs(hs.spaces.allSpaces()) do
  hs.spaces.gotoSpace(spaces[1])
  hs.spaces.removeSpace(spaces[2])
end
-- ...merspoon.app/Contents/Resources/extensions/hs/spaces.lua:882: attempt to index a nil value (local 'child')
-- stack traceback:
-- 	...merspoon.app/Contents/Resources/extensions/hs/spaces.lua:882: in function 'hs.spaces.removeSpace'
-- 	[string "for _, spaces in pairs(hs.spaces.allSpaces())..."]:3: in main chunk
-- 	[C]: in function 'xpcall'
-- 	...poon.app/Contents/Resources/extensions/hs/_coresetup.lua:525: in function <...poon.app/Contents/Resources/extensions/hs/_coresetup.lua:505>

I've tried increasing hs.spaces.MCwaitTime, but I have a sneaking suspicion that this has something to do with #3636, perhaps something was changed in macOS 14.5?

FWIW, I've also checked out and built #3638, and the issue also occurs with that version, too. 😢

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions