LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   trouble with the way man pages are displayed (https://www.linuxquestions.org/questions/slackware-14/trouble-with-the-way-man-pages-are-displayed-433486/)

win32sux 04-09-2006 07:15 PM

trouble with the way man pages are displayed
 
i'm having an issue with the way my man pages are displaying from my xterm... they seem to display fine from a console (runlevel 3), but when i'm in X11, and i look at a man page from my xterm, they display in an awkward manner... for example, here's a snippet of what a "man diff" looks like:
Code:

DIFF(1)                          User Commands                        DIFF(1)

NAME
iff - compare files line by line

SYNOPSIS
diffOPTION]... FILES

DESCRIPTION
ompare files line by line.

      -i--ignore-case
gnore case differences in file contents.

      --ignore-file-name-case
gnore case when comparing file names.

see how the text is like cut off to the left and stuff?? :confused:

i'm sure i messed something up somewhere but i can't figure-out what, and i'm not exactly sure where to look... so far i've recompiled man, groff, and x11 with no luck...

any guidance you could give me with this issue would be most appreciated...

thanks in advance...

edavis 04-09-2006 07:50 PM

Does this happen in any other terminal emulators such as aterm, rxvt, konsole or gnome-terminal?

win32sux 04-09-2006 07:53 PM

i just tried with xfterm4 and yeah, it happens there also... :(

edavis 04-09-2006 08:07 PM

I'd suggest removepkg man groff and installpkg'ing those again from Pat's vanilla packages. Something could of gotten screwy. Have you updated anything big lately? Does this happen in all man pages or just a select few?

win32sux 04-09-2006 08:36 PM

okay, i might test with patrick's packages in a minute...

meanwhile, i'm am starting to suspect that libtermcap might have something to do with this... any thoughts on that?? i uninstalled it a few days ago during a cleanup... so right now i installed libtermcap again and i recompiled groff and man but still no luck... however, if the problem is with the terminals themselves (and not groff/man) then perhaps i need to recompile X11 (xterm) in order for it to work?? hmmm, well, i'm gonna do some googling before i recompile X11 again cuz on my box it takes about an hour and 15 minutes to compile X11... hehe...

in response to your questions: yeah, i've updated lots of stuff during the past weeks, but i can't remember exactly when the man pages started getting messed-up...

and yeah, it seems to happen to all man pages... here's some more snippets for your enjoyment :) :

Code:

NAME
quid - proxy caching server

SYNOPSIS
squid  -dhsvzCDFNRVYX [ -lfacility ] [ -fconfig-file ] [ -[ au
      port ] [ -ksignal

DESCRIPTION
squids a high-performance proxy caching server for web clients,  sup-
      porting FTP, gopher, and HTTP data objects.  Unlike traditional caching
      software, squidandles all requests in a  single,  non-blocking,  I/O-
      driven process.

      squideeps meta data and especially hot objects cached in RAM, caches
      DNS lookups, supports non-blocking DNS lookups, and implements negative
      caching of failed requests.

Code:

NAME
p - copy files and directories

SYNOPSIS
cp[options]file path
      cp[options]file... directory

      POSIX options: [-fiprR][--]

dditional POSIX 1003.1-2003 options: [-HLP]

NU file-utils 4.0 options (shortest form):
      [-abdfilprsuvxPR][-SSUFFIX][-V{numbered,existing,simple}]
[--backup=CONTROL][--sparse=WHEN][--help][--version][--]

dditional GNU file-utils 4.1 options (shortest form):


Code:

NAME
etstat  - Print network connections, routing tables, interface statis-
      tics, masquerade connections, and multicast memberships

SYNOPSIS
netstataddress_family_options]  [--tcp-t  [--udp-u  [--raw-w
      [--listening-l [--all-a [--numeric-n [--numeric-hosts[umeric-
      ports]--numeric-ports  [--symbolic-N    [--extend-e--extend-e]
      [--timers-o [--program-p [--verbose-v [--continuous-c]

netstat--route-r              [address_family_options]
      [--extend-e--extend-e]  [--verbose-v  [--numeric-n  [--numeric-
hosts[umeric-ports]--numeric-ports [--continuous-c]

netstat--interfaces-i [iface] [--all-a [--extend-e--extend-e]
      [--verbose-v      [--program-p      [--numeric-n      [--numeric-
hosts[umeric-ports]--numeric-ports [--continuous-c]

BTW, thanks for your input!!! :)

win32sux 04-09-2006 09:18 PM

okay, well, i was thinking bash itself might have something to do with it... so after installing libtermcap i went ahead and recompiled bash to see if it made any difference... the man page problem still happens, but i can see that, at least, bash enjoyed the libtermcap install:
Code:

bash-3.1$ ldd /bin/bash
        libtermcap.so.2 => /lib/libtermcap.so.2 (0x4001e000)
        libdl.so.2 => /lib/libdl.so.2 (0x40022000)
        libc.so.6 => /lib/libc.so.6 (0x40027000)
        /lib/ld-linux.so.2 (0x40000000)

UPDATE: just tried with patrick's groff/man packages for 10.2 and no luck...

edavis 04-09-2006 09:50 PM

Some greps in /var/log/packages/ shows that libtermcap.so.2 is actually installed in the aaa_elflibs package. I don't know libtermcap well enough, so maybe this is normal but even after I removepkg libtermcap I was able to view man pages and run bash without a hitch. So I don't believe libtermcap is the problem. I still think it has something to do with groff and/or man (maybe even less for all I know). I'm still sticking to my suggestion of removing man and groff and just installing them again. You shouldn't have to recompile X. If it was only happening in xterm then I'd suggest it but if the problem is terminal emulator neutral then it's something with the programs they're calling. Just my two cents, good luck.

UPDATE: Just read your edit, so nevermind about my suggestion. I'll keep poking around google but I don't have a clue anymore.

win32sux 04-10-2006 12:25 AM

yeah, recompiling X11 didn't help... i also recompiled XFCE just in case... nothing... well, i'm wasted for today... i'll keep at it tomorrow though... i'll keep you posted... if you think of anything please do post... once again, thanks for all your help...

/bin/bash 04-10-2006 05:09 AM

What is TERM variable set to?
echo $TERM
Try changing it, e.g. if it is set to xterm then change it to linux or visa-versa.

<edit> You can also try turning on or off the auto-margin by adding -am or -nam to the $TERM variable for auto-margin or no-auto-margin respectivly.

http://www.linuxmanpages.com/man7/term.7.php

win32sux 04-10-2006 09:26 AM

Quote:

Originally Posted by /bin/bash
What is TERM variable set to?
echo $TERM
Try changing it, e.g. if it is set to xterm then change it to linux or visa-versa.

<edit> You can also try turning on or off the auto-margin by adding -am or -nam to the $TERM variable for auto-margin or no-auto-margin respectivly.

http://www.linuxmanpages.com/man7/term.7.php

thanks man!!! that seems to have been it!!! :)

if i do a
Code:

TERM=linux
then the pages display properly...

if i then go back to what i had (xterm) with a:
Code:

TERM=xterm
then the pages display in the awkward manner again...

so now i'm reading the link you posted in an effort to understand what might have caused this change on my system in the first place, and of course how to change it back permanently and stuff...

thanks a million!!!

win32sux 04-10-2006 09:54 AM

when you guys open an xterm and do a:
Code:

echo $TERM
what do you get??

after a fresh boot, i get "linux" when i do it at a console (runlevel 3) but i get "xterm" when i do it from my xterm in X11 (runlevel 4)...

win32sux 04-10-2006 11:13 AM

been tryin' to figure-out how to change the value of $TERM to "linux" for X11 sessions on a system-wide level but no luck... i'd like to make it so that it gets set for all users... could you show me how to do this?? which file must i edit?? :confused:

win32sux 04-10-2006 12:25 PM

well i think i found out how to change $TERM to "linux" for all X11 sessions... i did it by opening the /usr/X11/bin/startx file and changing this:
Code:

clientargs=""
to this:
Code:

clientargs="-tn linux"
from "man xterm":
Quote:

-tn name
This option specifies the name of the terminal type to be set
in the TERM environment variable. It corresponds to the
termName resource. This terminal type must exist in the termi-
nal database (termcap or terminfo, depending on how xterm is
built) and should have li# and co# entries. If the terminal
type is not found, xterm uses the built-in list ``xterm'',
``vt102'', etc.
the problem is that it apparently made X11 load without a window manager... so it was quite a weird and interesting sight indeed... hehe... kinda like a stripped-down version of twm...

so i guess this kinda thing isn't set for the entire X11 session... i can always start an xterm within X11 by using "xterm -tn linux" and then it works fine, though... i just thought it would be more kosher to make it so that whenever a user executes "xterm" they will have that term open with a $TERM value of "linux" so that everything displays properly (specially man pages)...

Alien_Hominid 04-10-2006 12:43 PM

That's strange. I have TERM set as xterm and everything works normally in xterm (man pages too). Just tried for curiosity.

win32sux 04-10-2006 12:47 PM

okay, i came-up with a cheap/stupid work-around...

basically, i created a shell script ( /usr/bin/xterm ) which contains the following:
Code:

#!/bin/bash
/usr/bin/X11/xterm -tn linux "$@" &

so now when someone executes "xterm", that script will get run and it will run the real xterm with the -tn linux option... hence, the xterm will open with the $TERM variable set to "linux"...

win32sux 04-10-2006 01:03 PM

Quote:

Originally Posted by Alien_Hominid
That's strange. I have TERM set as xterm and everything works normally in xterm (man pages too). Just tried for curiosity.

yeah, who knows what i've done to get myself into these circumstances... :) ... i'm sure that if i re-installed slackware the issue would be resolved, but that's not really an option for me right now... i much rather keep looking into this whenever i can to see if i can eventually figure-out exactly why this happened to me...

PS: this couldn't have anything to do with libreadline, right?? just wondering...

Alien_Hominid 04-10-2006 01:34 PM

Ok, just removed readline. No difference. Should I reboot? It is working normally after unset TERM.
The only error: terminal is not working functionally but man pages are correct. And the strangest thing that it only affects Gnome terminal not xterm.

edavis 04-10-2006 01:41 PM

ah wow, Environment variables.. completely slipped my mind.

Glad you got it to work man, keep us updated if you ever find out how you got it to not display properly in the first place.

win32sux 04-10-2006 01:48 PM

Quote:

Originally Posted by Alien_Hominid
Ok, just removed readline. No difference. Should I reboot? It is working normally after unset TERM.
The only error: terminal is not working functionally but man pages are correct. And the strangest thing that it only affects Gnome terminal not xterm.

what readline version are you using?? i compiled the 5.1 from -current, replacing the 4.3 from -10.2... by looking at the -current changelog i can see that patrick recompiled a lot of stuff at the time he upgraded readline, but i can't tell which particular packages where the ones that *needed* a recompile before this day:
Quote:

Thu Feb 16 14:01:26 CST 2006
OK, I think I have everything that used libreadline.so.4 recompiled
anyways, it was just a hunch... i mean, it's called "readline" and well the problem i have with the man pages seems like less or groff or whatever was having problems "reading the lines" properly so i figured it *might* have something to do... :)

win32sux 04-10-2006 01:49 PM

Quote:

Originally Posted by edavis
Glad you got it to work man, keep us updated if you ever find out how you got it to not display properly in the first place.

you can count on it... ;)

Alien_Hominid 04-10-2006 01:50 PM

I'm using readline from current without recompile.

win32sux 04-10-2006 01:55 PM

Quote:

Originally Posted by Alien_Hominid
I'm using readline from current (no recompile).

but like, on 10.2?? or are you using -current entirely??

cuz i'm on a 10.2, but i've recompiled the hell out of this thing so a lot of my versions are equal to what's in -current even though i haven't downloaded any binaries from -current...

Alien_Hominid 04-10-2006 01:59 PM

Most packages are from current except the most vital ones like aaa_base, aaa_elflibs, alsa, kernel headers and X (it's from dropline because it gives me more fps than the Slackware ones).

Alien_Hominid 04-10-2006 02:07 PM

Just rebooted. Readline does not affect anything (everything works normally), unsetting TERM gives only warning. Your problem is not here.

kodon 04-10-2006 02:40 PM

checked to see if anything is wrong with the termcap?

win32sux 04-10-2006 03:10 PM

Quote:

Originally Posted by Alien_Hominid
Just rebooted. Readline does not affect anything (everything works normally), unsetting TERM gives only warning. Your problem is not here.

thanks for that feedback...

Quote:

Originally Posted by kodon
checked to see if anything is wrong with the termcap?

please elaborate... how do i check that??

kodon 04-10-2006 04:33 PM

i'm not positive on the correct way to debug it,
but this is the stock slack xterm settings in termcap.

Code:

# Entry for an xterm. Insert mode has been disabled.
vs|xterm|xterm-color|vs100|xterm terminal emulator (X Window System):\
        :am:bs:mi@:km:co#80:li#55:\
        :im@:ei@:\
        :ct=\E[3k:ue=\E[m:\
        :is=\E[m\E[?1l\E>:\
        :rs=\E[m\E[?1l\E>:\
        :eA=\E)0:as=^N:ae=^O:ac=aaffggjjkkllmmnnooqqssttuuvvwwxx:\
        :kI=\E[2~:kD=\177:kP=\E[5~:kN=\E[6~:\
        :k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:k5=\E[15~:\
        :k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:k0=\E[21~:\
        :F1=\E[23~:F2=\E[24~:\
        :kh=\E[H:kH=\EOw:\
        :ks=:ke=:\
        :te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:\
        :tc=vt-generic:

# Some other entries for the same xterm.
v2|xterms|vs100s|xterm small window:\
        :co#80:li#24:tc=xterm:
vb|xterm-bold|xterm with bold instead of underline:\
        :us=\E[1m:tc=xterm:
vi|xterm-ins|xterm with insert mode:\
        :mi:im=\E[4h:ei=\E[4l:tc=xterm:

the man page goes over some of the abbreviations.
you can also use `infocmp` to determine the settings from terminfo.
also, if man is the only command effected...maybe something in man.conf?
i did see some results similar to this behaviour in searches from users who had switched their encoding or such.

other interesting reads:
/usr/doc/Linux-HOWTOs/Keyboard-and-Console-HOWTO
/usr/doc/Linux-HOWTOs/Text-Terminal-HOWTO

/bin/bash 04-10-2006 10:15 PM

You should be able to set the $TERM variable in /etc/profile file.

win32sux 04-13-2006 06:28 AM

Quote:

Originally Posted by /bin/bash
You should be able to set the $TERM variable in /etc/profile file.

yeah, that's actually one of the first things i looked at... but it was already set to "linux" there... either way, i still haven't figured this thing out, and i'm noticing some weird behavior with my back key and some other stuff when i'm in less...

i don't trust my install anymore (not just for the reason posted on this thread), i really did put it through hell with all my upgrades and recompiles of everything in sight... so as soon as i have a window of opportunity i will be doing a re-install of slack 10.2... after i install all the official patches, i will proceed to be much more conservative when it comes to upgrading my stuff... i look forward to having a stable install as i had before i was infected by the upgrading/recompiling madness... :)


All times are GMT -5. The time now is 08:01 PM.