commit 87bd16e470b2d7a45f38c7402037ad1bcf91ded9
parent 410744210386c8305da047e1a0e91f798c2cac0c
Author: Muhammad Saheed <89859744+MainKt@users.noreply.github.com>
Date: Wed, 26 Nov 2025 02:08:32 +0530
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()`
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/runtime/lua/man.lua b/runtime/lua/man.lua
@@ -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 }