highline icon indicating copy to clipboard operation
highline copied to clipboard

Please make HighLine beautiful like Yeoman

Open FooBarWidget opened this issue 11 years ago • 7 comments

I discovered Yeoman recently and I'm really impressed by their terminal interface. Yeowman is a scaffold generator similar to "rails generate", but it's general-purpose and written in JavaScript. Their terminal interface:

  • ...use colors.
  • ...support arrow keys.
  • ...rewrite prompts after the user has answered, to make it look more beautiful.
  • ...is not restricted to printing text up to down. For example their menu interface moves the cursor using the arrow keys.

I feel very good when using Yeoman's interface. I had the feeling that it's very user friendly. I want my users to feel good as well when using my software's interface. So it would be really great if you can make HighLine beautiful as Yeoman.

It's really hard to explain Yeoman's interface. I've posted a screenshot here that gives you some idea of how it works, but for the full experience you should really try it out yourself.

screen shot 2013-12-11 at 10 47 58

For example, when asking for permission to track usage, it first displays a regular Y/n prompt:

====: (Y/n)

Then when you answer "Y", the (Y/n) is erased and replaced with a colored Yes string, as the one you see in the screenshot.

When asking which modules to choose, the menu there actually supports the arrow keys! You can press Up and Down, and the menu chooser arrow will go up and down, and the text "Press to select" will disappear. When you press space, the filled bullet will become a hollow bullet.

These kinds of subtle things make the terminal feel modern again.

Yeoman uses the Inquirer library for implementing most of its interface. Inquirer is a bit like HighLine. Under the hood, Inquirer uses cli-color for terminal color formatting and basic cursor moving, and readline for text prompts.

FooBarWidget avatar Dec 11 '13 10:12 FooBarWidget

I'm not against these ideas. I would support pull requests that made these changes.

JEG2 avatar Dec 11 '13 17:12 JEG2

Has anybody made any progress on this? If not, anybody want to help me tackle it?

ezekg avatar Dec 06 '14 04:12 ezekg

I don't have time to try to implement something right now, but if you take a stab I'd be happy to help review and provide feedback.

I'm not sure this'll be useful, but here's some code from when I was playing around trying to do something similar w/ Thor: https://github.com/maxlinc/pacto/blob/simulator/lib/pacto/cli/selector.rb

maxlinc avatar Jan 14 '15 19:01 maxlinc

We are currently planning the next major version of HighLine. We will include a discussion of this issue in the plans we make for that release.

JEG2 avatar Feb 05 '15 02:02 JEG2

A lot of the Yoeman features are available in inquirer.rb based on the inquirer.js used by Yoeman

donaldguy avatar Feb 13 '15 06:02 donaldguy

This is very interesting. inquirer.rb looks like a HighLine competitor. I wasn't aware of it. Thanks for sharing.

JEG2 avatar Feb 13 '15 16:02 JEG2

:+1: on interactive inputs, (Y/n) for agree and [default] for defaults to be closer to conventions everywhere else for CLIs

brancz avatar Mar 07 '15 19:03 brancz