As-is when reloading X resources using the USR1 signal st leaks display server connections. This will not be noticeable under normal usage but if you reload a lot then after some time new programs will fail to start and fall over with the error of "Maximum amount of clients reached".
This should be reproducible by calling killall -q -USR1 st 200 times or so.
The count of this command should represent the number of display connections:
$ lsof -U | grep -E "^st\s" | wc -l
1
(1 here for one terminal)
As-is this number should be incremented by however many st windows are open every time X resources are loaded.
This has to do with that the xrdb_load function opens a connection to the X display when reloading resources, but does not close said connection when it is done.
Just wanted to drop a note here as the https://st.suckless.org/patches/xresources-with-reload-signal/ patch for st refers to this project as a reference.
As-is when reloading X resources using the USR1 signal st leaks display server connections. This will not be noticeable under normal usage but if you reload a lot then after some time new programs will fail to start and fall over with the error of "Maximum amount of clients reached".
This should be reproducible by calling
killall -q -USR1 st
200 times or so.The count of this command should represent the number of display connections:
(1 here for one terminal)
As-is this number should be incremented by however many st windows are open every time X resources are loaded.
This has to do with that the
xrdb_load
function opens a connection to the X display when reloading resources, but does not close said connection when it is done.https://github.com/gnotclub/xst/blob/293b895061ac52ceb8eeef15d6447a917cf5ccd9/xst.c#L26-L37
Would recommend adding a
XCloseDisplay(dpy);
call at the end of the function.