Closed confusedkernel closed 1 year ago
"Process failed to start: too many open files" is a Unix issue that indicates too many files were open. I'm not really sure what causes this issue, but it could either indicate something wrong with the configuration or the check_is_root
function 🤔
Huh, seems like some people are also experiencing this issue with other plugins? https://github.com/folke/trouble.nvim/issues/173 https://github.com/neovim/neovim/issues/14192
My current fix is that I added ulimit -n 2048
to my shell config, but still not sure what exactly went wrong.
Update: it still doesn't work, I thought it did but then it didn't.
Hmm, weird stuff 🤔 Not sure what I can do here. We can keep the issue open for a while for better discoverability. The plugin does open files for reading. I could perhaps add some error handling so that you don't get annoyed by the error messages, but it's still not a fix ¯\(ツ)/¯ If you could comment a min. reproducible config, that would be of great help :)
Hello 👋
I just read the source code. I wonder if this is caused by the fact that the sub processes aren't closed after each invocation.
In the function start_job
, there's vim.fn.jobstart()
but no vim.fn.jobstop()
to close the spawned tasks.
There is indeed vim.fn.chanclose()
, though I wonder if it only closes the handle to stdout
instead of closing the subprocess entirely.
This would make sense, since the error message says "Process failed to start: too many open files: "/usr/local/bin/fish"", which could potentially mean that the shell invoked isn't closed.
I hope this could help diagnose root cause of the problem!
Hi, @leana8959! Thank you, that's pretty useful; I'll take a look at the job API and see if maybe I missed something ^_^
@nottyl, could you try the fix/jobstop
branch and see if that fixes your issue? I'm not sure it's actually going to do anything since jobstop
seems to forcefully terminate the process (which should be closed anyways), but it could :)
unfortunately, no... this is an odd bug to be honest
That's unfortunate :(
As a workaround, I would suggest either disabling the plugin in toggleterm or considering using a separate top-down terminal. I use iTerm2
triggered on command+shift+enter and wezterm
as a "work terminal". I've been using this setup for a couple of years now, and it works perfectly for me (I prefer to always have an open terminal with preserved state, not only inside nvim)
@nottyl Could you provide a minimum configuration that reproduces the error?
You can use nvim -u
to specify a init.lua
that's separate from your current config, and set NVIM_APPNAME
to adm_dbg
for example (learn more :h NVIM_APPNAME
)
Have a nice day :)
hey @nottyl, hope you're having a lovely day! i think the latest version should resolve your issue! lmk if it works for you!
gonna close this issue for now, i belive it should be fixed! feel free to reopen in case it's not :)
Hello, I was using
auto-dark-mode.nvim
and encountered this issue. Whenever I open the terminal usingtoggleterm.nvim
it shows this error.The screenshot below is the amount of files I currently opened. Is there any reason as to why this is happening and how can I resolve this issue?