-
Couldn't load subscription status.
- Fork 773
Description
mosh-server deadlocks when pastes >~10KB are pasted into something like vim.
The root cause is the mosh-server calling write into the fakepty master fd with size exceeding the kernel's fd buffer size. Vim stops consuming stdin as it has echoed the large output back to the user in stdout which is not being consumed by mosh-server as it's in a blocking write. So the stdout kernel buffer fills up and now we are in a deadlock.
I have some code that works for me on my fork (mooey5775@0b53d07) by adding buffering to the write on the fakepty master fd. It passes all current tests but may be a undesirable as:
- the buffer is 256 KB
- the circular buffer is some random implementation, maybe there is something more principled
- not sure about cross-platform portability?
but if you'd like it as a PR anyways please let me know, I can open one