Skip to content

fix(health): skip --version for Windows built-ins and fix CRLF#2727

Merged
ibhagwan merged 1 commit into
ibhagwan:mainfrom
Namacha411:fix/health-windows-builtin-tools
May 14, 2026
Merged

fix(health): skip --version for Windows built-ins and fix CRLF#2727
ibhagwan merged 1 commit into
ibhagwan:mainfrom
Namacha411:fix/health-windows-builtin-tools

Conversation

@Namacha411
Copy link
Copy Markdown
Contributor

@Namacha411 Namacha411 commented May 14, 2026

  1. On Japanese Windows, find --version invokes Windows' system find.exe which outputs an error in CP932 encoding, causing garbled text in :checkhealth. Also, dir has the same issue.

  2. Skip --version for these Windows built-ins and report them as available without a version string. Also switch to utils.io_system() to avoid CRLF-corrupted version strings on Windows.

Summary by CodeRabbit

  • Bug Fixes
    • Improved tool detection to use more reliable version checking mechanism.
    • Added Windows compatibility for built-in commands to prevent UTF-8 encoding errors.
    • Enhanced version string retrieval for accurate tool identification.

Review Change Stack

Windows' find.exe and dir do not support --version and output
error messages in the system code page (e.g. CP932 on Japanese
Windows), causing garbled text in checkhealth. Also switch to
utils.io_system() to fix version strings containing trailing \r
from Windows CRLF line endings.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3f0cb675-9724-45a1-9004-f75301c75022

📥 Commits

Reviewing files that changed from the base of the PR and between 97376e3 and 4a09f13.

📒 Files selected for processing (1)
  • lua/fzf-lua/_health.lua

📝 Walkthrough

Walkthrough

The health check module updates its tool-existence verification to use a utility-based system call approach and adds a Windows-specific bypass for built-in commands that produce non-UTF-8 error output when called with --version.

Changes

Health Check Tool Detection

Layer / File(s) Summary
Tool detection with Windows bypass
lua/fzf-lua/_health.lua
The have(tool, nowarn) helper adds a Windows early return for built-in find and dir commands, switches to utils.io_system({ tool, "--version" }) for version probing, extracts version from the first output line, and determines success from the returned rc code instead of vim.v.shell_error.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A Windows tweak, a cleaner way,
To probe for tools throughout the day,
No more shell errors in the night—
Just swift utilities, version'd right! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'fix(health): skip --version for Windows built-ins and fix CRLF' directly addresses the main changes: bypassing --version for Windows built-ins (find, dir) and fixing CRLF issues in health checks.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ibhagwan
Copy link
Copy Markdown
Owner

Ty @Namacha411 !

@ibhagwan ibhagwan merged commit 1c2e7b6 into ibhagwan:main May 14, 2026
11 of 16 checks passed
@ibhagwan
Copy link
Copy Markdown
Owner

@phanen, unrelated to the changes in this PR, the headless wrapper now core dumps on exit on nightly, might be a bug in the upstream HEAD, need to keep an eye on it:

  --|---------|---------|---------|---------|---------|---------|----
  01| cli.lua                                                        
  02| devicons.lua                                                   
  03| fzf-lua-scm-1.rockspec                                         
  04| gen_options.lua                                                
  05| headless_fd.sh                                                 
  06| init.lua                                                       
  07| make_cli.lua                                                   
  08| mini.sh                                                        
  09| minimal_init.lua                                               
  10|Aborted (core dumped)                                           
  11|                                                                
  12|[Process exited 134]

@phanen
Copy link
Copy Markdown
Collaborator

phanen commented May 14, 2026

I can reproduce locally
( ignore the werid cmdline, that's my nvim wrapper)

Core was generated by `/home/phan/b/neovim/build/bin/nvim --cmd nn\ \<nowait\>\ s\ \<c-w\>'
'nn\ sd\ \<cmd\>call\ Restart\(123\)\<cr\>'
'nn\ s\<space\>\ \<cmd\>call\ Restart\(124\)\<cr\>'
'nn\ sa\ \<cmd\>call\ Restart\(125\)\<cr\>'
'nn\ s\}\ \<cmd\>cgetexpr\ v:errmsg\<bar\>copen\<cr\>'
'nn\ sf\ \<cmd\>let\ g:reload_env\[\'VER\'\]=input\(\'\',\ \'\~/.local/share/bob/v\',\ \'dir\'\)-\>split\(\'/\'\)\[-1\]\<cr\>'
'nn\ \<nowait\>\ \<c-s\>\ \<cmd\>quit\!\<cr\>'
'function\!\ Restart\(magic\)'
'\ \ if\ exists\(\":restart\"\)\ ==\ 2'
'\ \ \ \ call\ writefile\(\[\],\ \"/tmp/vim_sess_pending\"\)'
'\ \ \ \ exe\ \"sil\!wa\!\|mks\!/tmp/reload.vim\|restart\"'
'\ \ else'
'\ \ \ \ exe\ \"sil\!wa\!\|mks\!/tmp/reload.vim\|cq\!\"\ .\ a:magic'
'\ \ endif'
'\ \ \"\ restart\!'
'endfunction +if\ filereadable\(\'/tmp/vim_sess_pending\'\)\ \|\ call\ delete\(\'/tmp/vim_sess_pending\'\)\ \|\ exe\ \'so\ /tmp/reload.vim\'\ \|\ endif --luamod-dev -u NONE -l /home
/phan/b/fzf-lua/scripts/../lua/fzf-lua/spawn.lua return'
'\ \ --\ opts'
'\ \ \{'
'\ \ \ \ g\ =\ \{'
'\ \ \ \ \ \ _fzf_lua_server\ =\ \#\[\[/run/user/1000/fzf-lua.1778757895.1066529.0\]\]\ \>\ 0\ and\ \[\[/run/user/1000/fzf-lua.1778757895.1066529.0\]\]\ or\ nil,'
'\ \ \ \ \ \ _devicons_path\ =\ \[\[/home/phan/b/fzf-lua/scripts/../deps/nvim-web-devicons\]\],'
'\ \ \ \ \ \ _devicons_setup\ =\ \[\[/home/phan/b/fzf-lua/scripts/devicons.lua\]\],'
'\ \ \ \ \},'
--Type <RET> for more, q to quit, c to continue without paging--
'\ \ \ \ debug\ =\ \[\[false\]\]\ ==\ \[\[v\]\]\ and\ \[\[v\]\]\ or\ false,'
'\ \ \ \ file_icons\ =\ \[\[devicons\]\]\ ==\ true\ or\ \[\[devicons\]\],'
'\ \ \ \ git_icons\ =\ false,'
'\ \ \ \ color_icons\ =\ true,'
'\ \ \ \ contents\ =\ \[\[rg\ --files\ --sort=path\]\],'
'\ \ \ \ cmd\ =\ \[\[rg\ --files\ --sort=path\]\],'
'\ \ \ \ cwd\ =\ vim.fn.expand\(\[\[/home/phan/b/fzf-lua/deps/fzf-lua/scripts\]\]\),'
'\ \ \ \ fn_transform\ =\ \[==\['
'\ \ \ \ \ \ return\ require\(\"fzf-lua.make_entry\"\).file'
'\ \ \ \ \]==\],'
'\ \ \ \ fn_preprocess\ =\ \[==\['
'\ \ \ \ \ \ return\ require\(\"fzf-lua.make_entry\"\).preprocess'
'\ \ \ \ \]==\]'
'\ \ \}'
''.
Program terminated with signal SIGABRT, Aborted.
#0  0x00007f9b7529a29c in ?? () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007f9b7529a29c in ?? () from /usr/lib/libc.so.6
#1  0x00007f9b7523e7d0 in raise () from /usr/lib/libc.so.6
#2  0x00007f9b75225681 in abort () from /usr/lib/libc.so.6
#3  0x0000563ca4a5350a in loop_uv_run (loop=<optimized out>, ms=0) at /home/phan/b/neovim/src/nvim/event/loop.c:44
#4  loop_poll_events (loop=<optimized out>, ms=0) at /home/phan/b/neovim/src/nvim/event/loop.c:80
#5  event_teardown () at /home/phan/b/neovim/src/nvim/main.c:179
#6  os_exit (r=r@entry=0) at /home/phan/b/neovim/src/nvim/main.c:718
#7  0x0000563ca4c44d20 in getout (exitval=0) at /home/phan/b/neovim/src/nvim/main.c:880
#8  0x0000563ca4c32a84 in nlua_os_exit (lstate=0x7f9b755c2380) at /home/phan/b/neovim/src/nvim/lua/executor.c:611
#9  0x0000563ca4e85776 in lj_BC_FUNCC ()
#10 0x0000563ca4e7027a in lua_pcall (L=L@entry=0x7f9b755c2380, nargs=nargs@entry=2, nresults=nresults@entry=0, errfunc=errfunc@entry=-4) at lj_api.c:1106
#11 0x0000563ca4c2a1c1 in nlua_pcall (lstate=lstate@entry=0x7f9b755c2380, nargs=nargs@entry=2, nresults=nresults@entry=0) at /home/phan/b/neovim/src/nvim/lua/executor.c:328
#12 0x0000563ca4c322c1 in nlua_fast_cfpcall (lstate=0x7f9b755c2380, nargs=2, nresult=0, flags=0) at /home/phan/b/neovim/src/nvim/lua/executor.c:371
#13 0x0000563ca4ee2e3b in uv__wait_children (loop=0x563ca50bf800 <main_loop>) at /home/phan/b/neovim/.deps/build/src/libuv/src/unix/process.c:174
#14 0x0000563ca4ee5354 in uv__signal_event (loop=loop@entry=0x563ca50bf800 <main_loop>, w=w@entry=0x563ca50bfa30 <main_loop+560>, events=events@entry=1)
    at /home/phan/b/neovim/.deps/build/src/libuv/src/unix/signal.c:481
#15 0x0000563ca4eedf17 in uv__io_poll (loop=loop@entry=0x563ca50bf800 <main_loop>, timeout=0) at /home/phan/b/neovim/.deps/build/src/libuv/src/unix/linux.c:1562
#16 0x0000563ca4eda304 in uv_run (loop=0x563ca50bf800 <main_loop>, mode=mode@entry=UV_RUN_NOWAIT) at /home/phan/b/neovim/.deps/build/src/libuv/src/unix/core.c:460
#17 0x0000563ca4c44ab3 in loop_uv_run (loop=<optimized out>, ms=0) at /home/phan/b/neovim/src/nvim/event/loop.c:59
#18 loop_poll_events (loop=<optimized out>, ms=0) at /home/phan/b/neovim/src/nvim/event/loop.c:80
#19 event_teardown () at /home/phan/b/neovim/src/nvim/main.c:179
#20 os_exit (r=r@entry=0) at /home/phan/b/neovim/src/nvim/main.c:718
#21 0x0000563ca4c44d20 in getout (exitval=0) at /home/phan/b/neovim/src/nvim/main.c:880
#22 0x0000563ca4c32a84 in nlua_os_exit (lstate=0x7f9b755c2380) at /home/phan/b/neovim/src/nvim/lua/executor.c:611
#23 0x0000563ca4e85776 in lj_BC_FUNCC ()
#24 0x0000563ca4e7027a in lua_pcall (L=L@entry=0x7f9b755c2380, nargs=nargs@entry=0, nresults=nresults@entry=0, errfunc=errfunc@entry=-2) at lj_api.c:1106
#25 0x0000563ca4c2a1c1 in nlua_pcall (lstate=lstate@entry=0x7f9b755c2380, nargs=nargs@entry=0, nresults=nresults@entry=0) at /home/phan/b/neovim/src/nvim/lua/executor.c:328
#26 0x0000563ca4c328f4 in nlua_schedule_event (argv=<optimized out>) at /home/phan/b/neovim/src/nvim/lua/executor.c:537
#27 0x0000563ca4b6c09b in multiqueue_process_events (self=0x563cd2134270) at /home/phan/b/neovim/src/nvim/event/multiqueue.c:159
#28 0x0000563ca4c32a15 in nlua_loop_poll (lstate=0x7f9b755c2380) at /home/phan/b/neovim/src/nvim/lua/executor.c:579
#29 0x0000563ca4e85776 in lj_BC_FUNCC ()
#30 0x0000563ca4e7027a in lua_pcall (L=L@entry=0x7f9b755c2380, nargs=nargs@entry=0, nresults=nresults@entry=0, errfunc=errfunc@entry=-2) at lj_api.c:1106
#31 0x0000563ca4c2a1c1 in nlua_pcall (lstate=0x7f9b755c2380, nargs=0, nresults=0) at /home/phan/b/neovim/src/nvim/lua/executor.c:328
#32 0x0000563ca4c3a9b4 in nlua_exec_file (path=<optimized out>) at /home/phan/b/neovim/src/nvim/lua/executor.c:2114
#33 0x0000563ca4a5bb59 in main (argc=<optimized out>, argv=<optimized out>) at /home/phan/b/neovim/src/nvim/main.c:682

@phanen
Copy link
Copy Markdown
Collaborator

phanen commented May 14, 2026

bisect to neovim/neovim@9432e6c

@phanen
Copy link
Copy Markdown
Collaborator

phanen commented May 14, 2026

seems related to the startup time

my wrapper slow down nvim start a bit, so I can observe it.

@ibhagwan
Copy link
Copy Markdown
Owner

seems related to the startup time

my wrapper slow down nvim start a bit, so I can observe it.

Have you figured out of this is an upstream issue or something we need to fix on our end?

@phanen
Copy link
Copy Markdown
Collaborator

phanen commented May 15, 2026

I created neovim/neovim#39783.

@phanen
Copy link
Copy Markdown
Collaborator

phanen commented May 15, 2026

It only happened on ci now. https://github.com/ibhagwan/fzf-lua/actions/runs/25858259493/job/75981405952

I'll try if it's possible to workaround

@phanen
Copy link
Copy Markdown
Collaborator

phanen commented May 15, 2026

Ok, can be fixed in #2728.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants