ri output can't be piped into less
I'm running ri version 2.5.8 and ruby 1.9.2. If I try something like ri Enu开发者_如何学运维merable | less
, the paging is broken in less. I see output but I can't use CTRL-F or CTRL-B to page back and forward. If I try to, I just see the literal "^F" and "^B" characters output at the bottom of the screen. What's wrong?
Try ri -T String | less
.
If you want that behavior always you could put alias ri='ri -T'
in your ~/.bashrc
or ~/.bash_profile
or ~/.profile
, which ever you use.
Try PAGER=/usr/bin/less ri Enumerable
- specifying pager in environment variables did the trick for me.
For a permanent solution do something like echo "export PAGER=/usr/bin/less" >> ~/.bash_profile && source ~/.bash_profile
I can reproduce the problem on OSX 10.6 terminal and iTerm2 with ri version 2.5.8 and ruby 1.9.2. Did anyone find a fix? At the moment I can use the scrollbar of my graphical terminal client, but it gets tedious.
As a workaround I use the ORI gem, ri from within irb: https://github.com/dadooda/ori
精彩评论