Skip to content

Commit 8d91347

Browse files
committed
fix(zsh): set manpager correctly for batman pager mode
MANPAGER=batman alone makes man(1) invoke batman with no args, which falls into the fzf-search branch and discards the formatted page from stdin. Wrap with BATMAN_IS_BEING_MANPAGER=yes so batman runs as a pager, and set MANROFFOPT=-c per `batman --export-env` to suppress mandoc's SGR escapes before bat re-highlights.
1 parent 15baff7 commit 8d91347

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

conf.d/zsh/functions.zsh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# set https://github.com/victor-gp/cmd-help-sublime-syntax
2-
export MANPAGER='batman'
2+
# batman must run in pager mode when invoked by man(1); without
3+
# BATMAN_IS_BEING_MANPAGER it falls into the fzf-search branch and discards stdin
4+
export MANPAGER='env BATMAN_IS_BEING_MANPAGER=yes batman'
5+
export MANROFFOPT='-c'
36
# alias bathelp="sed 's/.\x08//g' | bat --plain --language=help --strip-ansi=always --theme='Monokai Extended'"
47
alias bathelp="sed 's/.\x08//g' | bat --plain --language=help --strip-ansi=always"
58
help() {

0 commit comments

Comments
 (0)