Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
man-page looks weird
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Jean-Paul
Guru
Guru


Joined: 13 Apr 2009
Posts: 307

PostPosted: Sat Mar 23, 2024 2:28 pm    Post subject: man-page looks weird Reply with quote

I discovered a funny 'problem'.
All man-pages look like this.
Code:
equery − Gentoo Package Query Tool

is a collection of modules for querying the state of Gentoo pack‐
ages, files and USE flags.

Output a help message.
Be  less verbose where possible. In some modules, this option can
increase the output speed.
Do not colorize output.
Turn off automatic pipe detection. Use this option if you do  not
want  to  detect if the output is being directed to the screen or
to another program and adjust color and verbosity accordingly.
Display Gentoolkit’s version. Please include this in all bug  re‐
ports. (see below)

uses  a  system of modules. Each module has both a long and short
name. The list below uses the notation "module (m)", where  m  is
the  short  name  and  module is the long name.  You can view the
message for a specific module by using as either a global  option
(after  and  before  the module name) or as a local option (after
the module name).

List the package that owns FILE.  Normally, only one package will
own FILE. If multiple packages own the same file it should be re‐
ported. (see below)
...

I have a freshly installed system running Plasma Desktop.

Does anyone have an idea where I could look?
_________________
”Everything should be made as simple as possible, but no simpler.” – Albert Einstein
Back to top
View user's profile Send private message
sublogic
Apprentice
Apprentice


Joined: 21 Mar 2022
Posts: 222
Location: Pennsylvania, USA

PostPosted: Sat Mar 23, 2024 10:41 pm    Post subject: Reply with quote

The missing text in your display is either bold or underlined in mine. is your TERM variable set correctly ?
Back to top
View user's profile Send private message
Jean-Paul
Guru
Guru


Joined: 13 Apr 2009
Posts: 307

PostPosted: Sat Mar 23, 2024 11:10 pm    Post subject: Reply with quote

$TERM looks good to me.
Code:
echo $TERM
xterm-256color


I use alacritty as a terminal.
but I also get the same result with konsole
_________________
”Everything should be made as simple as possible, but no simpler.” – Albert Einstein
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 324
Location: Naarm/Melbourne, Australia

PostPosted: Sun Mar 24, 2024 12:31 am    Post subject: Reply with quote

Do you have the GROFF_NO_SGR variable set in your environment, i.e. as shown by the output of running the `env` command? If so, what is its value? If it's not set, could you please report whether you still get the issue after doing:

Code:
$ export GROFF_NO_SGR=1
Back to top
View user's profile Send private message
Jean-Paul
Guru
Guru


Joined: 13 Apr 2009
Posts: 307

PostPosted: Sun Mar 24, 2024 10:12 am    Post subject: Reply with quote

Thanks for the reply.
This variable is set and the output is the same.
Code:
env | grep -E "GROFF|MAN|TERM"
SESSION_MANAGER=local/purix:@/tmp/.ICE-unix/2509,unix/purix:/tmp/.ICE-unix/2509
COLORTERM=truecolor
LESS_TERMCAP_se=
LESS_TERMCAP_so=
GROFF_ENCODING=UTF8
MANPATH=/usr/share/gcc-data/x86_64-pc-linux-gnu/13/man:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.41/man:/usr/local/share/man:/usr/share/man:/usr/lib/rust/man
GROFF_NO_SGR=yes
TERM=xterm-256color
LESS_TERMCAP_mb=
LESS_TERMCAP_me=
LESS_TERMCAP_md=
MANPAGER=less -s -M +Gg
LESS_TERMCAP_ue=
LESS_TERMCAP_us=

It's not a problem with the color or the font, it's all perfect.
The problem is that the formatting is completely missing. Everything is displayed in one block.
A typical man page looks like this
Code:
Name
cat - concatenate files and print on the standard output
Synopsis
cat [OPTION]... [FILE]...
Description

Concatenate FILE(s), or standard input, to standard output.

-A, --show-all
    equivalent to -vET
-b, --number-nonblank
    number nonempty output lines
etc
ect

I get everything in one block. An yes, with color and bold font.
Code:
cat - concatenate files and print on the
standard output Synopsiscat [OPTION]...
[FILE]...Description Concatenate FILE(s)
, or stand ard input, to standard output.
-A, --show-all e quivalent to -vET -b, --
number-nonblank num ber nonempty output l
ines
ect
ect

I've never seen anything like this before
_________________
”Everything should be made as simple as possible, but no simpler.” – Albert Einstein
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 324
Location: Naarm/Melbourne, Australia

PostPosted: Sun Mar 24, 2024 11:19 am    Post subject: Reply with quote

Do you still get the same formatting issues if you don't involve `less`? E.g. if you run:

Code:
groff -man -Tutf8 /usr/share/man/man1/cat.1
Back to top
View user's profile Send private message
Jean-Paul
Guru
Guru


Joined: 13 Apr 2009
Posts: 307

PostPosted: Sun Mar 24, 2024 2:09 pm    Post subject: Reply with quote

No, unfortunately not.
Code:
LC_TIME=en_US.UTF-8 groff -man -Tutf8 /usr/share/man/man1/cat.1
preconv: error: can't open '/usr/share/man/man1/cat.1': No such file or directory

But the file is there.
Code:
ls -l /usr/share/man/man1/cat*
-rw-r--r-- 1 root root 1084 23. Mär 11:13 /usr/share/man/man1/cat.1.bz2


When I unzip cat.1.bz2, I get a file cat.1.
With this file, the man-page works as it should, but without colors.
Code:
groff -man -Tutf8 /home/jean/Downloads/extrakt/cat.1
CAT(1)                   Dienstprogramme für Benutzer                   CAT(1)

BEZEICHNUNG
       cat - Dateien aneinanderhängen und in die Standardausgabe schreiben

ÜBERSICHT
       cat [OPTION]… [DATEI]…

BESCHREIBUNG
       DATEI(en) auf Standardausgabe verketten.

       liest ohne DATEI oder wenn DATEI - ist, aus der Standardeingabe.

       -A, --show-all
              äquivalent zu -vET

       -b, --number-nonblank
              nichtleere Ausgabezeilen nummerieren, überschreibt -n
ect ...

_________________
”Everything should be made as simple as possible, but no simpler.” – Albert Einstein
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 324
Location: Naarm/Melbourne, Australia

PostPosted: Sun Mar 24, 2024 11:34 pm    Post subject: Reply with quote

Oh, my apologies, i forgot that man pages are bzip2'ed by default; i have them uncompressed on my system, as i use mandoc instead of man-db+groff, and mandoc doesn't support bzip2 compression (but given the size of storage nowadays, i feel the savings offered by compression are marginal).

So, what's being done by the groff(1) command i provided is page layout, without any sequences to indicate typeface formatting (as per the relevant man(7) macros, such as '.B' for bold, in the man page source). The fact that the layout is correct prior to less(1) getting involved suggests that something is indeed going askew once `less` gets a hold of the output of `groff`.

There are known issues with how `less` uses overstriking sequences, rather than ECMA-48 escape sequences: https://git.savannah.gnu.org/cgit/groff.git/tree/PROBLEMS?id=198346d187de9e340bbf9d4f80c2dc4d42f5f74e#n121. i would suggest seeing what happens if you don't set GROFF_NO_SGR, and additionally, what happens if you pass the '-R'/'--RAW-CONTROL-CHARACTERS' option to `less`. (On my own system, i don't have the MANPAGER variable set, but i have LESS set to "--RAW-CONTROL-CHARS --no-init --save-marks".)
Back to top
View user's profile Send private message
Jean-Paul
Guru
Guru


Joined: 13 Apr 2009
Posts: 307

PostPosted: Mon Mar 25, 2024 9:18 am    Post subject: Reply with quote

Unfortunately no change.
Neither 'GROFF_NO_SGR=no' nor LESS='-R'/'--RAW-CONTROL-CHARACTERS' does anything.

I think this is a fundamental problem that may have arisen during installation.
I'm now switching to the new profile and rebuilding the system.
Maybe the problem will solve itself, maybe I'll reinstall, or maybe I'll switch to mandoc.

In any case, I thank you very very much for your help.
_________________
”Everything should be made as simple as possible, but no simpler.” – Albert Einstein
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum