hammerspoon: Version v0.9.96 breaks hs.window.filter.new

> hs.window.filter.new(nil)
2022-03-29 09:36:27: -- Loading extensions: window.filter
...merspoon.app/Contents/Resources/extensions/hs/spaces.lua:71: attempt to index a nil value (local 'contents')
stack traceback:
	...merspoon.app/Contents/Resources/extensions/hs/spaces.lua:71: in local 'getDockExitTemplates'
	...merspoon.app/Contents/Resources/extensions/hs/spaces.lua:76: in main chunk
	[C]: in function 'rawrequire'
	...poon.app/Contents/Resources/extensions/hs/_coresetup.lua:662: in function 'require'
	...n.app/Contents/Resources/extensions/hs/window_filter.lua:1530: in main chunk
	[C]: in function 'rawrequire'
	...poon.app/Contents/Resources/extensions/hs/_coresetup.lua:662: in function 'require'
	(...tail calls...)
	[C]: in function 'rawrequire'
	...poon.app/Contents/Resources/extensions/hs/_coresetup.lua:662: in function 'require'
	...merspoon.app/Contents/Resources/extensions/hs/window.lua:1027: in function <...merspoon.app/Contents/Resources/extensions/hs/window.lua:1025>
	(...tail calls...)
	[string "return hs.window.filter.new(nil)"]:1: 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>

Calling it with anything seems to crash. Haven’t investigated.

This is on Big Sur v11.6.3, Intel

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Go for it

Confirmed that that fixes the issue

> hs.window.filter.new(nil)
2022-03-29 18:10:06: -- Loading extensions: window.filter
hs.window.filter: ... (0x600001c03b80)

@asmagill Any objections if I push out 0.9.97 with the current fix for this?

And spaces is used by window filter to watch for space changes to identify windows on other spaces.

I really need to rewrite hs.window.filter now – with the additions to hs.spaces and the addition of hs.axuielement, the module is in dire need of a complete overhaul.

@Grazfather aha, good catch! @latenitefilms exactly that. Preparing a PR now 😃

Hah! I found the issue.

Instead of finding Dock.app, it’s finding Docker.app, which doesn’t have that file.

application("Dock"):path() is the problem.