View previous topic :: View next topic |
Author |
Message |
Jean-Paul Guru
Joined: 13 Apr 2009 Posts: 307
|
Posted: Sat Mar 23, 2024 2:28 pm Post subject: man-page looks weird |
|
|
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 |
|
|
sublogic Apprentice
Joined: 21 Mar 2022 Posts: 232 Location: Pennsylvania, USA
|
Posted: Sat Mar 23, 2024 10:41 pm Post subject: |
|
|
The missing text in your display is either bold or underlined in mine. is your TERM variable set correctly ? |
|
Back to top |
|
|
Jean-Paul Guru
Joined: 13 Apr 2009 Posts: 307
|
Posted: Sat Mar 23, 2024 11:10 pm Post subject: |
|
|
$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 |
|
|
flexibeast Guru
Joined: 04 Apr 2022 Posts: 325 Location: Naarm/Melbourne, Australia
|
Posted: Sun Mar 24, 2024 12:31 am Post subject: |
|
|
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 |
|
|
Jean-Paul Guru
Joined: 13 Apr 2009 Posts: 307
|
Posted: Sun Mar 24, 2024 10:12 am Post subject: |
|
|
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 |
|
|
flexibeast Guru
Joined: 04 Apr 2022 Posts: 325 Location: Naarm/Melbourne, Australia
|
Posted: Sun Mar 24, 2024 11:19 am Post subject: |
|
|
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 |
|
|
Jean-Paul Guru
Joined: 13 Apr 2009 Posts: 307
|
Posted: Sun Mar 24, 2024 2:09 pm Post subject: |
|
|
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 |
|
|
flexibeast Guru
Joined: 04 Apr 2022 Posts: 325 Location: Naarm/Melbourne, Australia
|
Posted: Sun Mar 24, 2024 11:34 pm Post subject: |
|
|
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 |
|
|
Jean-Paul Guru
Joined: 13 Apr 2009 Posts: 307
|
Posted: Mon Mar 25, 2024 9:18 am Post subject: |
|
|
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 |
|
|
t3k0 n00b
Joined: 27 Nov 2007 Posts: 58
|
Posted: Thu May 16, 2024 10:13 pm Post subject: |
|
|
Hi all.
I have exactly the same issue. I assume it appeard after upgrading my system to the default/linux/amd64/23.0/split-usr/desktop profile. But I don't know for sure if it was caused by this.
I tried to find information here https://wiki.gentoo.org/wiki/Man_page but nothing which helped.
Further, I tried different values with the MANWIDTH variable. But this didn't have any impact at all.
I can confirm that after flexibeast's comment:
Code: | groff -man -Tutf8 /usr/share/man/man1/cat.1 |
The layout looked as it is supposed to look. (I bunzip2-ed first.)
Another maybe helpful hint despite the weird format.
I cannot search for the "-" minus sign. It is not found.
First I thought this is an encoding issue, so I switched the termial from UTF-8 to ISO-8859-15. But no difference.
Quote: | if you don't set GROFF_NO_SGR |
If I unset (which it was in the first place) it looks still wrong. (Same for GROFF_NO_SGR=1)
You're command for less Quote: | -R'/'--RAW-CONTROL-CHARACTERS | does not work.
It results in
Code: | There is no -/ option ("less --help" for help)
Press RETURN to continue
|
What should we do?
Should we file a bug report since more users seem to be affected? |
|
Back to top |
|
|
thumper Guru
Joined: 06 Dec 2002 Posts: 553 Location: Venice FL
|
Posted: Fri May 17, 2024 12:28 am Post subject: |
|
|
t3k0 wrote: | Hi all.
What should we do?
Should we file a bug report since more users seem to be affected? |
I have exactly the same issue, had it for about a year it seems, occasionally I'd spend an afternoon trying to fix it, but to no avail.
George |
|
Back to top |
|
|
t3k0 n00b
Joined: 27 Nov 2007 Posts: 58
|
Posted: Fri May 17, 2024 4:00 pm Post subject: |
|
|
To give some further input:
While investigating, I found this article https://lwn.net/Articles/947941/, which I thought could be related, because of the wrong minus "-" sign I mentioned above.
However, a downgrade to groff-1.22.4 did not solve the issue. While normally I should be concluding that it is not related to the change in groff-1.23.0 mentioned in this article, I still have the impression that it is related to a bug with this package. |
|
Back to top |
|
|
vthriller n00b
Joined: 20 May 2024 Posts: 5
|
Posted: Mon May 20, 2024 6:37 pm Post subject: |
|
|
t3k0 wrote: |
You're command for less Quote: | -R'/'--RAW-CONTROL-CHARACTERS | does not work.
It results in
Code: | There is no -/ option ("less --help" for help)
Press RETURN to continue
|
|
Just use either -R or --RAW-CONTROL-CHARACTERS, that's just two spellings of the same option. |
|
Back to top |
|
|
t3k0 n00b
Joined: 27 Nov 2007 Posts: 58
|
Posted: Mon May 20, 2024 6:50 pm Post subject: |
|
|
I could have figured this out myself.
But no effect.
I tried both
Code: | LESS="--RAW-CONTROL-CHARS" man [mymanpage] |
and just to be sure also
Code: | man --pager="less -R" [mymanpage] |
but to no success.
The man page is still in justification and the "-" sign is a different one than on my keyboard. |
|
Back to top |
|
|
|