Closed carbonin closed 9 years ago
@carbonin I was not able to reproduce the issue with the code on your gist.
Could rerun the gist exactly as it is and confirm the issue?
Can you share the output of the following?
$ ruby -r highline -ve 'p [HighLine::VERSION, HighLine::SystemExtensions::CHARACTER_MODE]'
My output is as follow:
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
["1.7.7", "stty"]
Oh, I forgot to mention that at the pagination prompt you have to press 'q' to stop. Then you should get the traceback.
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
["1.7.7", "stty"]
Is the output from
$ ruby -r highline -ve 'p [HighLine::VERSION, HighLine::SystemExtensions::CHARACTER_MODE]'
Great, now I get the error.
If the fix is so simple, don't you want to fire a PR yourself? So you enter to the "hall of fame" of HighLine contributors :smiley:
But, if you prefer I can do it.
The branch is 1-7-stable
@carbonin
If the sentence has the exact same lines of HighLIne#page_at
maybe the proper behaviour would be "not even paginate", do you agree? (So it was a double bug ;-) )
I'm crafting the tests here and will push a patch soon.
Can I do PR to your fork branch so we merge it on our master altogether?
When calling
HighLine#say
aTypeError
is raised when printing the same number of lines as your$terminal.page_at
value.It can be reproduced with this gist: https://gist.github.com/carbonin/4163f462345581956f4b
Traceback:
A fix would be to change the
lines.slice(-2,1)
to[lines.last]
atlib/highline.rb:997
which I think would get the desired behaviour.The
$terminal.page_at
value can be increased as a temporary work around to prevent paging entirely, but that only works for me as my application typically has a fixed number of lines being printed.