ipc port is no longer valid

202 views
Skip to first unread message

Rémy Tauziac

unread,
Oct 12, 2021, 9:10:44 AM10/12/21
to Hammerspoon
I’m experiencing weird errors with Hammerspoon.

Very often, my console shows this message:
LuaSkin: hs.hotkey callback: ...rspoon.app/Contents/Resources/extensions/hs/ipc/init.lua:48: ipc port is no longer valid
stack traceback:
    [C]: in method 'sendMessage'
    ...rspoon.app/Contents/Resources/extensions/hs/ipc/init.lua:48: in function 'print'
    /Users/remy/.hammerspoon/init.lua:287: in function </Users/remy/.hammerspoon/init.lua:277>

The line 277 of my init file is a modal binding declaration:
resize_window_modal:bind("⌃⌥", hs.keycodes.map["t"], function()
...
end)
Within that function is a creation of an hs.task with possibly a callback function.

The hotkeys works perfectly but after triggering them a few times (from a dozen to just a couple times), they stop working and that message shows in the console. When I restart Hammerspoon it works again a few times until this error shows again.

---

My goal is to make Hammerspoon and Yabai work together, so far it’s been awesome: I can send commands to Yabai, fetch infos from Yabai and send them to Hammerspoon via cli, show overlays and window borders with hs.canvas, have several modal hotkeys to toggle between modes… There’s just that thing that stops working really often and I’m constantly restarting Hammerspoon to make it work again.

Any idea of what to look for?

Chris Jones

unread,
Oct 12, 2021, 5:13:48 PM10/12/21
to Rémy Tauziac, Hammerspoon
Hey Rémy

Is it possible to post your whole Hammerspoon config in a github gist/repo so we can take a look?

Cheers,
Chris

--
You received this message because you are subscribed to the Google Groups "Hammerspoon" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hammerspoon...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/hammerspoon/77a81452-50bc-4d49-9eea-191c93cf8886n%40googlegroups.com.


--
Cheers,

Chris

Rémy Tauziac

unread,
Oct 13, 2021, 8:50:12 AM10/13/21
to Hammerspoon
Hi,


The develop branch is the most up to date. I made a Readme so you hopefully can replicate my setting.

Cheers,

Rémy

roach dsadsa

unread,
Nov 2, 2021, 11:13:13 AM11/2/21
to Hammerspoon
I am also getting this message often, seems related to sending hs commands from the terminal.

(e.g.  io.popen(string.format('hs -c "GotoWindow({dir=\'east\'})"')) in neovim)

It works the first few times but then crashes. This seems to happen particularly when hs -c commands are sent in quick succession.

In the Hammerspoon Console I then get this error for commands:

> print("TEST")...rspoon.app/Contents/Resources/extensions/hs/ipc/init.lua:48: ipc port is no longer valid

stack traceback:

[C]: in method 'sendMessage'

...rspoon.app/Contents/Resources/extensions/hs/ipc/init.lua:48: in function 'print'

(...tail calls...)

[C]: in function 'xpcall'

...app/Contents/Resources/extensions/hs/_coresetup/init.lua:520: in function <...app/Contents/Resources/extensions/hs/_coresetup/init.lua:500>

Rémy Tauziac

unread,
Dec 16, 2021, 5:32:12 AM12/16/21
to Hammerspoon
It feels a lot smoother now, I don’t know from which version since I switched to another window manager a couple months ago but I guess it’s from 0.9.92… ?

Now I have the « dangling link » issue like in this thread. I’m on a Macbook pro 2015.
Not a huge deal but it means Yabai can’t send events to hs anymore.

Thanks!
Reply all
Reply to author
Forward
0 new messages