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()`

(cherry picked from commit 87bd16e470)
This commit is contained in:
Muhammad Saheed
2025-11-26 02:08:32 +05:30
committed by github-actions[bot]
parent d0ed06dcea
commit 5143419e22

View File

@@ -427,7 +427,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 }