Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highline ask method won't use same line

Tags:

ruby

highline

Setup:

  • Bash
  • Ruby 1.9.2
  • highline (1.6.13)

Description:

I'm fairly used to highline with some other projects, but haven't used it in a few months. Now, on a fresh install on Ruby 1.9.2, it doesn't seem to allow prompts to be answered on the same line.

So previously I would see something like:

 require "highline/import"
 ask "What is your favorite color?"

And get:

 What is your favorite color? |

Now I see something like:

 What is your favorite color?
 |

Where the pipe (|) symbol is my terminal cursor.

Any ideas why this change has occurred?

like image 948
wmarbut Avatar asked Jun 20 '12 01:06

wmarbut


1 Answers

Put a space at the end of the question string, eg

ask "What is your favorite color? "
like image 188
Tim Peters Avatar answered Sep 27 '22 20:09

Tim Peters