# HighLine freezes when using wrap\_at and page\_at

**URL:** <https://www.ruby-forum.com/t/highline-freezes-when-using-wrap-at-and-page-at/191595>\
**Category:** Ruby\
**Created:** [July 15, 2010, 12:40am UTC](https://www.ruby-forum.com/t/highline-freezes-when-using-wrap-at-and-page-at/191595 "2010-07-15T00:40:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![LAMBEAU\_Bernard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/5fc32e/32.png) [@LAMBEAU\_Bernard](https://www.ruby-forum.com/u/LAMBEAU_Bernard)\
**Post date:** [July 15, 2010, 12:40am UTC](https://www.ruby-forum.com/t/highline-freezes-when-using-wrap-at-and-page-at/191595/1 "2010-07-15T00:40:59Z")

</div>

Hi all,

I’m experimenting a small problem when trying to use HighLine with  
wrap\_at/page\_at options… The script below leads to a deadlock under  
MacOS  
with all ruby installations I have (rvm)

```
require 'rubygems'
require 'highline'
h = HighLine.new
h.wrap_at = 10
h.say "a"*100
```

Something I don’t understand ??

thanks,  
B

---

<div class="post-metadata">

**Author:** ![LAMBEAU\_Bernard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/5fc32e/32.png) [@LAMBEAU\_Bernard](https://www.ruby-forum.com/u/LAMBEAU_Bernard)\
**Post date:** [July 15, 2010, 5:38am UTC](https://www.ruby-forum.com/t/highline-freezes-when-using-wrap-at-and-page-at/191595/2 "2010-07-15T05:38:54Z")

</div>

On Jul 14, 2010, at 5:40 PM, LAMBEAU Bernard wrote:

> Something I don’t understand ??

Nope, it looks like you found a bug. I believe I have it fixed on  
Github now:

[GitHub - JEG2/highline: A higher level command-line oriented interface.](http://github.com/JEG2/highline)

Can you confirm that code works for you?

Thanks.

James Edward G. II

---

<div class="post-metadata">

**Author:** ![LAMBEAU\_Bernard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/5fc32e/32.png) [@LAMBEAU\_Bernard](https://www.ruby-forum.com/u/LAMBEAU_Bernard)\
**Post date:** [July 15, 2010, 8:32am UTC](https://www.ruby-forum.com/t/highline-freezes-when-using-wrap-at-and-page-at/191595/3 "2010-07-15T08:32:41Z")

</div>

Works perfectly now 🙂

P.S. Don’t know it’s a bug, but with page\_at set to :auto, two lines are  
hidden on each page (probably due to the “\n-- press enter/return to  
continue or q to stop – q” message). Don’t know if it’s clear, … you  
can  
try the following:

```
require 'rubygems'
require 'highline'
h = HighLine.new
h.page_at = :auto
h.say((1..1000).collect{|i| i.to_s}.join("\n"))
```

On a terminal 80x24, the first page starts shows 3 to 24, the second  
page 27  
to 48, and so on.

Anyway, using “h.page\_at = h.output\_rows-2” works fine…

Thanks a lot,  
B

On Thu, Jul 15, 2010 at 5:38 AM, James Edward G. II  
\<removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![LAMBEAU\_Bernard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/5fc32e/32.png) [@LAMBEAU\_Bernard](https://www.ruby-forum.com/u/LAMBEAU_Bernard)\
**Post date:** [July 15, 2010, 4:37pm UTC](https://www.ruby-forum.com/t/highline-freezes-when-using-wrap-at-and-page-at/191595/4 "2010-07-15T16:37:27Z")

</div>

On Jul 15, 2010, at 1:31 AM, LAMBEAU Bernard wrote:

> On a terminal 80x24, the first page starts shows 3 to 24, the second page 27  
> to 48, and so on.

Looks like a bug to me, yep.

> Anyway, using “h.page\_at = h.output\_rows-2” works fine…

I applied your fix:

[GitHub - JEG2/highline: A higher level command-line oriented interface.](http://github.com/JEG2/highline)

Thanks again!

James Edward G. II

---

<div class="post-metadata">

**Author:** ![LAMBEAU\_Bernard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/5fc32e/32.png) [@LAMBEAU\_Bernard](https://www.ruby-forum.com/u/LAMBEAU_Bernard)\
**Post date:** [July 15, 2010, 10:07pm UTC](https://www.ruby-forum.com/t/highline-freezes-when-using-wrap-at-and-page-at/191595/5 "2010-07-15T22:07:42Z")

</div>

Works fine !

Thanks again  
B

On Thu, Jul 15, 2010 at 4:27 PM, James Edward G. II  
\<removed\_email\_address@domain.invalid
