fix(man.lua): :Man slow/hangs if MANPAGER is set #36689

Problem:
When `MANPAGER` is set to something like 'nvim +Man!',
`vim.system({ 'nvim' })` call waits forever for input and times out
after 10 seconds in `system()` and the assert on `stdout` being not
`nil` fails.

Solution:
Set `MANPAGER=cat` when calling `system()`
This commit is contained in:
Muhammad Saheed authored and GitHub committed 2025-11-25 12:38:32 -08:00
1 parent 4107442103
commit 87bd16e470
1 file changed
+2 -1
+2 -1
View File
@@ -428,7 +428,8 @@ local function get_page(path, silent)
if localfile_arg == nil then
local mpath = get_path('man')
-- Check for -l support.
localfile_arg = (mpath and system({ 'man', '-l', mpath }, true) or '') ~= ''
localfile_arg = (mpath and system({ 'man', '-l', mpath }, true, { MANPAGER = 'cat' }) or '')
~= ''
end
local cmd = localfile_arg and { 'man', '-l', path } or { 'man', path }