From 87bd16e470b2d7a45f38c7402037ad1bcf91ded9 Mon Sep 17 00:00:00 2001 From: Muhammad Saheed <89859744+MainKt@users.noreply.github.com> Date: Wed, 26 Nov 2025 02:08:32 +0530 Subject: [PATCH] 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()` --- runtime/lua/man.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/lua/man.lua b/runtime/lua/man.lua index 5c13426fc0..cb6bd85c1e 100644 --- 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 }