helix
helix copied to clipboard
Make shell_impl concurrent
Based on #3136. Fixes #3127 and might fix #3133.
This changes shell_impl to concurrently write to stdin while reading from stdout and stderr. This way processes will not block, if their input buffer is full, which is the current behavior.
I renamed shell_impl to shell_impl_async and added a new shell_impl as a blocking wrapper.
Performance considerations
~Since shell_impl_async needs to take ownership of the input, I changed the input type to Rope. This can be constructed from the RopeSlice with RopeSlice::into in O(log n). We might want to copy the whole rope and give the current selection as an extra parameter which would be O(1), but a bit more ugly.~
This is not true. It's O(log n) either way. And obviously O(n) to pipe everything into the process. Don't know what I thought.
Those changes are because I based this PR on another PR of mine. I guess the other one should be merged first. But I'm not quite sure how else to do something like this.
Can you rebase this PR now since https://github.com/helix-editor/helix/pull/3136 was merged?
Thanks!