-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shell is freezing #101
Comments
Thanks for reporting, I'll look into this more ASAP :) |
diff --git a/lua/flatten/core.lua b/lua/flatten/core.lua
index 0d1622f..5645f62 100644
--- a/lua/flatten/core.lua
+++ b/lua/flatten/core.lua
@@ -2,7 +2,7 @@ local M = {}
function M.unblock_guest(guest_pipe)
local response_sock = vim.fn.sockconnect("pipe", guest_pipe, { rpc = true })
- vim.rpcnotify(
+ pcall(vim.rpcrequest,
response_sock,
"nvim_exec_lua",
---@diagnostic disable-next-line: param-type-mismatch But it has to be
|
There are some complexities with using |
I can't put my finger around how the channel becomes invalid. The only two places where channel gets closed is in the autocmd callback and before the sleep loop.
|
Hello!
Describe the bug
Blocked shell sometimes does not unblock. I cannot provide steps to reproduce because it happens sporadically.
The quickest way I'm able to reproduce is committing with lazygit inside toggleterm and setting up an auto command to delete the buffer after writing. It happens 1-5 times out of 10.
Expected behavior
Shell to unblock
Desktop (please complete the following information):
Additional context
After many trials and errors: scheduling API functions in callbacks, deferring them with long timeouts, with short timeouts, I may have an idea of what's happening:
My idea is that the channel gets closed before guest fully receives the command to close. That's why I tried to give the guest a good second to get the command. With this patch it looks that the freezing is not happening. I'm going to test drive this patch for a few days to see if that's indeed the case.
Also, I'm also deferring closing the channel in
maybe_block()
just for good measure and I've increased sleep time since (I think) there's not point in wasting CPU time waking up and going to sleep every second.Please, provide any thoughts and ideas on this issue.
The text was updated successfully, but these errors were encountered: