From 5143419e2251efd7a3a63f0c7f34bbc51b46f239 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()` (cherry picked from commit 87bd16e470b2d7a45f38c7402037ad1bcf91ded9) --- 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 8f47757c2f..f0478dc113 100644 --- a/runtime/lua/man.lua +++ b/runtime/lua/man.lua @@ -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 }