I think I already use less:Use less instead of more for PAGER.
[mkru@riis ~ 0] echo $PAGER
less
more is lessI would check:
env | grep -e MANPAGER -e LESS=
and that there is no-X
My env is
LESS=’-RMsg --use-color --mouse ‘
[mkru@riis ~ 0] env | grep -e MANPAGER -e LESS=
[mkru@riis ~ 0]
Looks like this indeed helps.try export LESS_LINES=0 or -1 and see if happens again
#!/bin/sh
trap 'get_window_size' WINCH # trap when a user has resized the window
get_window_size() {
export LESS_LINES=$(tput li)
#echo LULULUL
}
Try with:Code:[mkru@riis ~ 0] env | grep -e MANPAGER -e LESS= [mkru@riis ~ 0]
Looks like this indeed helps.
However, if I export 0, then the man output occupies only half of the terminal screen.
If I export -1, then the man output does not utilize the last line of the terminal screen.
I wish man still use the whole terminal screen.
export MANWIDTH='tty'
setnenv
with export
and add =
after variable, and for TERMCAP
use LESS_TERMCAP_*=$'\e[*'
for .bashrcsetenv LESSOPEN "| /usr/local/bin/src-hilite-lesspipe.sh %s"
# Colored man pages
setenv LESS_TERMCAP_mb `echo "\e[5m"` # begin blinking
setenv LESS_TERMCAP_mh `echo "\e[2;90m"` # begin half-bright
setenv LESS_TERMCAP_md `echo "\e[1;31m"` # begin double-bright (+bold red)
setenv LESS_TERMCAP_us `echo "\e[1;3;34m"` # begin (no)underline (+bold italic cyan)
#setenv LESS_TERMCAP_us `echo "\e[1;3;4;34m"` # begin underline (+bold italic cyan)
setenv LESS_TERMCAP_so `echo "\e[7m"` # begin standout-mode (inverse)
setenv LESS_TERMCAP_mr `echo "\e[7m"` # begin reverse video
setenv LESS_TERMCAP_ue `echo "\e[0m"` # end underline
setenv LESS_TERMCAP_se `echo "\e[0m"` # end standout-mode
setenv LESS_TERMCAP_me `echo "\e[0m"` # end mode
#
setenv LESS '-RMsg --use-color --mouse '
#
setenv CLICOLORS 'YES'
setenv MANPAGER 'less '
setenv MANWIDTH 'tty'
setenv MANCOLOR
#
#setenv GROFF_NO_SGR 1
It does not change anything.Try with:
export MANWIDTH='tty'
...skipping...
even mean?titus@ubuntu:~$ uname -a
Linux ubuntu 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
titus@ubuntu:~$ strings `which less`|grep skipp
...skipping...
titus@ubuntu:~$
Honestly, I’m at loss here. I didn’t see thatIt does not change anything.
I don't understand why man pages on FreeBSD are f**ked up by default in the first place.
What does this...skipping...
even mean?
I have used multiple Linux distros and never came across such behavior.
…skipping…
for a long time, and can’t remember on which OS that was. AFAIK …skipping…
is encoded in the less in the forwback.c, please see both FreeBSD less source , and one that GNU uses for less (basically, the same)I have fresh 14.3 installation.Honestly, I’m at loss here. I didn’t see that “…skipping…” for a long time, and can’t remember on which OS that was. AFAIK “…skipping…” is encoded in the less in the forwback.c, please see both FreeBSD less source , and one that GNU uses for less (basically, the same)
I use bspwm and alacritty.Which terminal do you use? I can’t reproduce this problem in vt, konosole nor xterm even with setting env LESS empty. Judging by your colored man, you must have something set somewhere.
#
# ~/.bashrc
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
PS1="\[\e[32m\][\[\e[m\]\[\e[32m\]\u\[\e[m\]\[\e[32m\]@\[\e[m\]\[\e[32m\]\h\[\e[m\] \[\e[34m\]\W\[\e[m\] \[\e[31m\]\j\[\e[m\]\[\e[32m\]]\[\e[m\] "
shopt -s cdspell \
globstar
# Colored man pages
export LESS_TERMCAP_mb=$'\e[1;32m'
export LESS_TERMCAP_md=$'\e[1;32m'
export LESS_TERMCAP_me=$'\e[0m'
export LESS_TERMCAP_se=$'\e[0m'
export LESS_TERMCAP_so=$'\e[01;33m'
export LESS_TERMCAP_ue=$'\e[0m'
export LESS_TERMCAP_us=$'\e[1;4;31m'
# Groff version >= 1.23 directly emits terminal escape sequences instead of letting less do the translation.
# https://unix.stackexchange.com/questions/108699/documentation-on-less-termcap-variables/108840#108840
export GROFF_NO_SGR=""
# Allow displaying manual for command preceding the cursor by pressing Alt+h.
bind '"\eh": "\C-a\eb\ed\C-y\e#man \C-y\C-m\C-p\C-p\C-a\C-d\C-e"'
Then is probably something in Alacritty config – sorry I never even saw Alacritty, and I know jack about .toml. How your xterm behaves in this regard?I use bspwm and alacritty.
I checked that problem doesn't exist in tty before I startx.
The same.Then is probably something in Alacritty config – sorry I never even saw Alacritty, and I know jack about .toml. How your xterm behaves in this regard?
...skipping...
lines in xterm.Hm, and if you don’t start bspwm and start X with plain twm, how then xterm behaves?The same.
I can also see...skipping...
lines in xterm.
The same. I still seeHm, and if you don’t start bspwm and start X with plain twm, how then xterm behaves?
...skipping...
lines.In theOk, I have to add--mouse
argument for the pager.
The question is, where it should be added.
LESS
env variable, please see #8