Cary Swoveland
Cary Swoveland

Reputation: 110735

Why does Ruby's ri not return to a bash command prompt?

When I execute ri ... in a terminal on my Mac, I get, maybe, 50 blank lines, then the output I'm expecting, then a last line:

(END)

, with (END) displayed with white letters on black background. I am not returned to bash, however -- ri is still running, and I can't enter anything. Also, why all the blank lines?

Why is this happening?

Upvotes: 3

Views: 698

Answers (2)

agitatedString
agitatedString

Reputation: 19

Pager poltergeist? Maybe you would find bypassing whatever your default pager is altogether a useful thing. I often do. Try putting this code in your ~/.bashrc file and restart your terminal session (of course you can remove my comment if you don't have problems remembering obscure command arguments or enjoy rereading man pages):

alias ri='/usr/local/bin/ri -T'   # -T == --no-pager ... Send output directly to stdout, rather than to a pager. Pagers are damned annoying when the info you need disappears when you still need to see it ...

Upvotes: 2

mipadi
mipadi

Reputation: 411132

The output is being piped through a pager (the value of the environment variable $PAGER, probably /usr/bin/more or /usr/bin/less). This allows you to page through screenfuls of data by hitting the spacebar (among other nice features), instead of having to scroll up and down in the terminal. To exit, just type q.

Upvotes: 5

Related Questions