Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Crazy man output [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Timmer
Guru
Guru


Joined: 24 Aug 2004
Posts: 373
Location: Duluth, MN, USA

PostPosted: Mon Nov 30, 2009 12:50 pm    Post subject: Crazy man output [solved] Reply with quote

I tried to look at a man page the other day, and this is what I got:

Code:

ESC[1mNAMEESC[0m
       cp - copy files and directories

ESC[1mSYNOPSISESC[0m
       ESC[1mcp ESC[22m[ESC[4mOPTIONESC[24m]... [ESC[4m-TESC[24m] ESC[4mSOURCEESC[24m ESC[4mDEST
ESC[0m
       ESC[1mcp ESC[22m[ESC[4mOPTIONESC[24m]... ESC[4mSOURCEESC[24m... ESC[4mDIRECTORYESC[0m
       ESC[1mcp ESC[22m[ESC[4mOPTIONESC[24m]... ESC[4m-tESC[24m ESC[4mDIRECTORYESC[24m ESC[4mSOURCEESC[24m...

...


When I googled, I only got stuff about a bug with non-English UTF encoding. But I'm using English, so that's not my problem. So I'm stumped. Does anyone know how I can make my man pages readable again?


Last edited by Timmer on Wed Dec 02, 2009 3:54 am; edited 1 time in total
Back to top
View user's profile Send private message
marduk
Retired Dev
Retired Dev


Joined: 20 Sep 2002
Posts: 78

PostPosted: Mon Nov 30, 2009 2:10 pm    Post subject: Reply with quote

Those are escape sequences. Your pager should be able to know what do do with them. What are you using as your pager?
Back to top
View user's profile Send private message
Timmer
Guru
Guru


Joined: 24 Aug 2004
Posts: 373
Location: Duluth, MN, USA

PostPosted: Mon Nov 30, 2009 3:08 pm    Post subject: Reply with quote

I have no idea. How do I find out?
Back to top
View user's profile Send private message
ndse2112
Tux's lil' helper
Tux's lil' helper


Joined: 21 May 2007
Posts: 100

PostPosted: Mon Nov 30, 2009 3:19 pm    Post subject: Reply with quote

Code:
echo $PAGER
Back to top
View user's profile Send private message
Timmer
Guru
Guru


Joined: 24 Aug 2004
Posts: 373
Location: Duluth, MN, USA

PostPosted: Tue Dec 01, 2009 12:17 am    Post subject: Reply with quote

Oh. Hmm. It appears to be unset. That would probably be the problem. But unfortunately, I'm still in the dark. Google has told me that 'less -is' is the default, but it seems like I want to over ride that. It do that in /etc/man.conf apparently, but it doesn't tell me what other possible options would be. Suggestions?
Back to top
View user's profile Send private message
haarp
Guru
Guru


Joined: 31 Oct 2007
Posts: 535

PostPosted: Tue Dec 01, 2009 10:35 pm    Post subject: Reply with quote

Just put
Code:
export PAGER=less

into ~/.bashrc and you're done. But I'd recommend emerging 'most' instead of less. Does colorful manpages, much easier to read :)
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9691
Location: almost Mile High in the USA

PostPosted: Wed Dec 02, 2009 1:28 am    Post subject: Reply with quote

If you're using less, you need to set your environment variable for less(1) options ("LESS") to include -R if it's not already set (this is due to a change that Gentoo devs did to switch from old/traditional man/nroff overstrike method to ANSI, to "get with the times" (and make it easier to search)) :

(for bourne shells:)
Code:
LESS=-R; export LESS


This is becoming a FAQ... but... how would someone search for this problem? heh...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Timmer
Guru
Guru


Joined: 24 Aug 2004
Posts: 373
Location: Duluth, MN, USA

PostPosted: Wed Dec 02, 2009 3:53 am    Post subject: Reply with quote

ah. I figured we couldn't have gotten to the root of the problem yet. But I bet that's it.

I set PAGER to less, but that didn't do the trick. Then I set it to more, and that made things readable again. When I came back here to report that, I read the above post, and tried less -R. That works too.

Still going to try most, because it intrigues me. (Also, OT, but wondering what the next one after most will be called... mostest?)
Back to top
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Wed Dec 02, 2009 7:31 am    Post subject: Reply with quote

Strange that you don't have these 2 files
Code:
# cat /etc/env.d/99pager
# Configuration file for eselect
# This file has been automatically generated.
PAGER="/usr/bin/less"

Code:
# cat /etc/env.d/70less
LESSOPEN="|lesspipe.sh %s"
LESS="-R -M --shift 5"


You can always try eselect pager list/set to set your pager.
Back to top
View user's profile Send private message
Timmer
Guru
Guru


Joined: 24 Aug 2004
Posts: 373
Location: Duluth, MN, USA

PostPosted: Wed Dec 02, 2009 12:29 pm    Post subject: Reply with quote

I didn't have the first one, but I do have the second. Am I correct in guessing that it's supposed to be defining default options for less? Because it doesn't seem to be doing that.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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