Help with terminal man page reader

Discussion in 'Mac Apps and Mac App Store' started by Simon Liquid, Apr 5, 2004.

  1. Simon Liquid macrumors regular

    Joined:
    Jul 4, 2001
    Location:
    Iowa
    #1
    In Jaguar, if I typed 'man <whatever>' it would just spit out the text of the man page, one line of text being one line in the terminal buffer. Then after I'd gone through the whole page, it was still there in the buffer and I could scroll back to it if I wanted, so I could even have 2 or more man pages in the same window.

    Now in Panther, it handles them differently. It only puts one screen's worth up at a time and the only way to scroll is with arrow keys inside the terminal program. When done, it clears everything and goes back to the original prompt.

    How can I bring the old behavior back? Initially I thought it might be because of the change to bash but I tried changing to tsch and it did the same thing. Now I figure it must have something to do with the display programs but I can't even figure out what to mess with. When reading the man pages, the process name at the top of the terminal window starts out as 'grotty' and then changes to 'less.' I've tried a few things with both programs but nothing's made any difference so far.

    Please help, it's just a little thing but it has been irking me quite a lot lately.
     
  2. Westside guy macrumors 601

    Westside guy

    Joined:
    Oct 15, 2003
    Location:
    The soggy side of the Pacific NW
    #2
    Here's an indirect solution. I've found I prefer reading man pages using a GUI tool like manthor:

    http://www.versiontracker.com/dyn/moreinfo/macosx/10531

    Edit: Crap. It looks like those pages are gone. That's the problem with freeware on occasion... hopefully someone has the latest package somewhere (mine's a bit out of date I see)
     
  3. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #3
    Chain Some Commands

    man ls > /tmp/man_ls;more /tmp/man_list;rm /tmp/man_list

    Note that if you do this with 2 terminal windows at the same time you should use a different file name in the second one.
     
  4. reh macrumors 6502a

    Joined:
    Oct 24, 2003
    Location:
    Arkansas
    #4
    Save this script as ~/bin/gman or something. Found it on Mac OS X Hints a while back.

    Code:
    #!/bin/sh
    #
    # Converts the man page to a PDF file and then opens
    # it in your default PDF viewer.
    
    man -t $1 > /tmp/$1.ps
    pstopdf /tmp/$1.ps /tmp/$1.pdf
    open /tmp/$1.pdf
     
  5. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #5
    Specify a pager

    Found a much better answer (works for me in Panther):

    man -P more <command>

    i.e. man -P more ls
     
  6. Simon Liquid thread starter macrumors regular

    Joined:
    Jul 4, 2001
    Location:
    Iowa
    #6
    Thanks for all the answers. It looks like this last one will work best for me but maybe I'll hunt up one of those GUI programs Westside guy mentioned to try out when I have some time.
     
  7. w3steve macrumors newbie

    Joined:
    May 20, 2008
    Location:
    Berkeley USA
    #7
    Just change Terminal preferences

    I found this thread doing a search for the same problem (upgrading to Mac OS 10.5).

    From further reading I learned that this behavior is controlled by the rmcup and smcup settings for each terminal (xterm, vt100, etc.)

    (See this discussion of xterm under Solaris)

    I was rolling up my sleeves to edit the settings for xterm when I realized that I never used xterm in the past...huh! maybe that explains the changed behavior!

    So I opened terminal preferences, chose Settings -> Advanced and under Emulation I changed "Declare terminal as:" to vt100 (from xterm).

    Restarted terminal et voila! the output of man (and vi) remains in the terminal window buffer!

    steve
    my blog
     
  8. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #8
    You win the thread resurection prize! 4 years it was dead and you brought it back! :D
     

Share This Page