cmder
cmder copied to clipboard
Zombie SVN Processes
The function "get_svn_status" in clink.lua spawns a new svn process each time a command is executed in a directory containing a ".svn" directory. This is to check the status of the SVN repository and update the dirty/clean value. Unfortunately, these processes are not cleaned up as the pipe created by popen is never closed. This can be rectified by creating a local variable for the pipe and then closing it after we check if there are any lines.
Note: This behavior may also be present for Mercurial repositories. The structure of get_hg_status() is similar to that of get_svn_status(). I don't have any Mercurial repositories to test with.
Here is an updated version of the function.
function get_svn_status()
local file = io.popen("svn status -q")
for line in file:lines() do
file:close()
return false
end
file:close()
return true
end