-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Testers needed for multiprocess = true
#248
Comments
The good news is: I just changed the previewer from |
Fantastic! I guess the fixes to your issue #247 fixed this as well. ab8b1a1 - Latest commit restores |
Tested this on the neovim repository on my MacBook, still looks broken (like #247). I enabled debug mode, here's the command it runs:
Running this in a terminal and piping through less is also messed up. It seems like that command is printing raw terminal escape codes which messes up anything that expects printable characters only. As I try to scroll around with less, the screen gets cleared and changed all over the place, and even sometimes opens the print dialog. The top of the output also has:
If I pipe the output to a file, and then cat the file through less, it works as expected (other than the errors about the config section). It seems to be only when the headless nvim command is directly piped to another process that displays the output. |
As a followup, repeatedly running the command and piping to Is there something about how the stdout pipe from the nvim process sends EOF when it flushes a buffer even if there is still more to come? I haven't looked at the new implementation of this headless multiprocess mode but I think the stdout handling needs to be looked at a bit. Pipe should stay open the whole time and only send EOF/close the pipe when it's completely done. |
Vim:connection failed: connection refused This is abosultely fine, if you're running the command with To run without retreieving the config need to drop the nvim -n --headless --clean --cmd 'lua loadfile([[/Users/jdrouhard/.local/share/nvim/site/pack/packer/opt/fzf-lua/lua/fzf-lua/libuv.lua]])().spawn_stdio({debug=true,cmd=[[rg --files --hidden -g '\''!{.git,node_modules}/*'\'']],git_icons=true,file_icons=true,color_icons=true}, [[_G._devicons_path='\''/Users/jdrouhard/.local/share/nvim/site/pack/packer/start/nvim-web-devicons/lua/nvim-web-devicons.lua'\''; return require("make_entry").file]],[[return require("make_entry").preprocess]])'
The escape codes might be the issue! I'll test against different terminals (been using
I wonder what that may be, I'm going to install different terminals and do some testing (xterm, urxvt, kitty).
I'll look into this, ty so much for doing this and giving me great leads, I've disabled it as default for now as it seems that it needs some more polishing before being released in the wild :-) I feel it's close though! Let me know what you find out with |
Didn't help. It's not the color escape codes, it's definitely the output pipe from the headless nvim process not behaving correctly. I don't think the terminal will affect this since pipes are an OS thing. It might be a macOS pipe implementation thing since #251 also seems to be someone using a Mac. |
I wonder why, the pipe code is failry simple, roughly: -- I open two pipes to "/dev/stdout" and
-- "/dev/stderr" for error messages
local fd = uv.fs_open("/dev/stdout", "w", -1)
local pipe = uv.new_pipe(false)
pipe:open(fd)
-- then writing to the pipe with:
pipe:write(data, function(err) ... end) I'll have to boot to my MacOS to test this I guess, haven't done so in a long time :-) |
@jdrouhard it's possible to specify the output pipe in the command, would you be able to run a quick test and see which of these devices work best for you?
Below is how to modify the command to add the device ( nvim -n --headless --clean --cmd 'lua loadfile([[/Users/jdrouhard/.local/share/nvim/site/pack/packer/opt/fzf-lua/lua/fzf-lua/libuv.lua]])().spawn_stdio({stdout=[[/dev/tty]],cmd=[[rg --files --hidden -g '\''!{.git,node_modules}/*'\'']],git_icons=true,file_icons=true,color_icons=true}, [[_G._devicons_path='\''/Users/jdrouhard/.local/share/nvim/site/pack/packer/start/nvim-web-devicons/lua/nvim-web-devicons.lua'\''; return require("make_entry").file]],[[return require("make_entry").preprocess]])' |
Doesn't exhibit the premature EOF problem, but also isn't pipeable (it doesn't print to stdout) so I don't think this will actually work.
Doesn't exist for me. My tty happens to be
Prints nothing. |
I have an idea, I'm going to use lua |
@jdrouhard can you try this 4a013fd? |
Step ahead of you :) I tried that (missed You can do io.stdout:write(data)
io.stderr:write(data) for stdout/stderr. I think this will fully fix it. Thanks again for the quick turnaround! |
Correction, that commit doesn't fix it, but I have a diff that does. One sec.... |
This is amazing! so happy to have this properly fixed the performance enhancement is huge :-) |
Tysm @jdrouhard! just merged #252! |
@jdrouhard, just got confirmation it solved #251, with that in mind I feel this is ready to become the default once again :) |
@jdrouhard, there seems to be an issue with pressing In a large codebse, if I just run the command in the shell (no need for neovim/fzf-lua) and press Not sure why yet, any ideas welcome. Edit 1: it seems that if running the command piped data is still being received even after pressing |
My first guess is |
Further exloration: this issue does not happen when using What I need to figure out is how to determine a write failure (if possible) with |
yeah, I was hacking something together, but all Try something like: local success, errMsg = io.stdout:write(data)
if not success then
io.stderr:write("pipe:write error: " .. errMsg)
cb(true)
else
cb(nil)
end Or something like that. |
I was actually just in the process of committing this :-) Edit: forced pushed 704a81f as safer |
FYI, Works pretty well on my machine, very fast and responsive, try it out and let me know if you feel the difference? |
Seeing there's no activity here and no outstanding issues with multi-process I'm closing this. |
Background:
2d8a4e9 - This commit adds a new option named
multiprocess
, best described from the commit message:Turns out I was a bit ballsy and there are still issues with it (e.g. #247).
Before I re-enable it again as default I'd like to have some testers use this (perferably on large codebases) and let me know the results.
It's only possible to enable it for
files
,grep
andgit_files
, either through setup:Or by specifying it directly:
If
debug=true
is specified the neovim shell command will be printed into the:messages
stream so you can run the command directly in the shell and see if everything seems right, the command wraps a shell command and prints the output to the shell after additonal processing, for example:The command above is then piped to fzf (as a separate process) increasing performance and freeing the neovim UI to do it's thing.
Testers, comments, issues all welcome in this thread.
The text was updated successfully, but these errors were encountered: