ftplugin: sh: don't assume MANPAGER makes sense by benknoble · Pull Request #14679 · vim/vim

benknoble added a commit to benknoble/Dotfiles that referenced this pull request

May 1, 2024
vim/vim@2f25e40b1 (runtime: configure keywordpg for some file types
(#5566), 2023-08-23) added a new keywordprg for Shell files (it was
renamed from :Help to ShKeywordPrg in vim/vim@2a281ccca (runtime(sh):
Update ftplugin (#13213), 2023-10-07)).

Something about it craps out for me, though, dumping terminal garbage
all over the screen, and I prefer :Man anyway.

See also vim/vim#14679

@benknoble

Say you use Vim and set MANPAGER='vim -M +MANPAGER --not-a-term -'; then
:{Zs,S}hKeywordPrg (or K) will crap out and spew terminal garbage into
less when bash's "help" fails. This was introduced by 2f25e40
(runtime: configure keywordpg for some file types (vim#5566), 2023-08-23)
and may be present in other files touched by that commit.

Make the "man" invocation sensible by unsetting MANPAGER in the
environment.

Note that changing MANPAGER for `:terminal` is not needed; Vim within
Vim is perfectly fine.

chrisbra added a commit to chrisbra/vim-zsh that referenced this pull request

May 6, 2024
related: vim/vim#14679

Signed-off-by: Christian Brabandt <cb@256bit.org>

zeertzjq added a commit to zeertzjq/neovim that referenced this pull request

May 7, 2024
runtime(sh,zsh): clear $MANPAGER in ftplugin before shelling out

Say you use Vim and set MANPAGER='vim -M +MANPAGER --not-a-term -'; then
:{Zs,S}hKeywordPrg (or K) will crap out and spew terminal garbage into
less when bash's "help" fails. This was introduced by 2f25e40b1
(runtime: configure keywordpg for some file types (vim/vim#5566), 2023-08-23)
and may be present in other files touched by that commit.

Make the "man" invocation sensible by unsetting MANPAGER in the
environment.

Note that changing MANPAGER for `:terminal` is not needed; Vim within
Vim is perfectly fine.

closes: vim/vim#14679

vim/vim@8d8cb45

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>

zeertzjq added a commit to neovim/neovim that referenced this pull request

May 7, 2024
runtime(sh,zsh): clear $MANPAGER in ftplugin before shelling out

Say you use Vim and set MANPAGER='vim -M +MANPAGER --not-a-term -'; then
:{Zs,S}hKeywordPrg (or K) will crap out and spew terminal garbage into
less when bash's "help" fails. This was introduced by 2f25e40b1
(runtime: configure keywordpg for some file types (vim/vim#5566), 2023-08-23)
and may be present in other files touched by that commit.

Make the "man" invocation sensible by unsetting MANPAGER in the
environment.

Note that changing MANPAGER for `:terminal` is not needed; Vim within
Vim is perfectly fine.

closes: vim/vim#14679

vim/vim@8d8cb45

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>

@benknoble benknoble deleted the fix-ShKeywordPrg-manpager branch

May 11, 2024 16:42

huangyingw pushed a commit to huangyingw/neovim that referenced this pull request

May 31, 2024
runtime(sh,zsh): clear $MANPAGER in ftplugin before shelling out

Say you use Vim and set MANPAGER='vim -M +MANPAGER --not-a-term -'; then
:{Zs,S}hKeywordPrg (or K) will crap out and spew terminal garbage into
less when bash's "help" fails. This was introduced by 2f25e40b1
(runtime: configure keywordpg for some file types (vim/vim#5566), 2023-08-23)
and may be present in other files touched by that commit.

Make the "man" invocation sensible by unsetting MANPAGER in the
environment.

Note that changing MANPAGER for `:terminal` is not needed; Vim within
Vim is perfectly fine.

closes: vim/vim#14679

vim/vim@8d8cb45

Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>