MANPAGER program inside toolbox?

Hi everyone,

I’ve been working on using Neovim as a MANPAGER on Fedora Silverblue in a containerized setup, but I’ve hit a roadblock. My current setup involves running nvim through a script that detects whether it’s inside a Toolbox container or not:

#!/bin/sh

if [ -f /run/.toolboxenv ]; then
	source /run/.containerenv

	if [[ $name = "general" ]]; then
		# Run neovim directly
		/usr/bin/nvim "$@"
	fi

else
	toolbox run -c general nvim "$@"
fi

I’am trying to set the nvim as my man program

export MANPAGER='nvim +Man!'

The setup works fine inside the general container. However, outside the container, it doesn’t function as expected when I try to use man with Neovim as the MANPAGER. It seems to stall the terminal (like entering in a infinite loop).

  1. Has anyone managed to get export MANPAGER='nvim +Man!' working with Neovim in a Toolbox container on Silverblue? Maybe I am going with the wrong approach, don’t know someone more expert could help.

Thanks in advance for your help!