Comments (9)
Hi @ailisp,
Thanks for reporting the issue.
What exactly is happening on your setup?
What behaviour is inconsistent?
from highline.
Hi @abinoam Thanks for quick response. In a clone of current master branch. save the content I provide in previous comment as test.rb:
[boyao@new-host highline]$ bundler exec ./test.rb
agree readline=true?aaa
Please enter "yes" or "no".
agree readline=true?
agree readline=true?
Please enter "yes" or "no".
agree readline=true?
agree readline=true?yes
agree readline=false?
aaa
Please enter "yes" or "no".
agree readline=false?
Please enter "yes" or "no".
agree readline=false?
yes
I input aaa
, nothing and yes
for both case (readline=true
or false
), and you can see with readline=true
there's no extra newline after question, but a redundant question.
For choose
, if we have readline=true
then giving an invalid input, the question and menu will both display again, but for readline=false
only question will display again.
from highline.
I think I understood.
I've had a quick look at the code now and couldn't figure out a quick fix.
I'll try to take a look at it next week and try to fix it or at least provide a way to work around it.
👍
from highline.
I see that the use of readline = true
at agree
is pretty much unimplemented.
It doesn't even autocomplete for yes or no.
from highline.
Yes. just noticed the auto complete part is not implemented. And here's of some hacks I did for make choose
and agree
looks the same as readline=false
, it works but with some ugly hacks so I don't make a PR here direcly. I think you're more familiar with GNU Readline, but hope this can save you some time.
- readline replacement of
agree
https://github.com/ManageIQ/manageiq-appliance_console/pull/6/files#diff-11f3fdac8dc445b3e93dd2459f62b9a9 - readline replacement for
choose
, based on a modifiedask
, some observations of my experiments are in comments
https://github.com/ManageIQ/manageiq-appliance_console/pull/6/files#diff-70eae34541a813654c1e209ef9e093f4
from highline.
@ailisp Could you please have a look at PR #222 ?
from highline.
@abinoam Just tested with ask
and choose
, readline=true
works consistently as expected and ompletion also works. Thanks for the fix!
from highline.
Thank you very much @ailisp! I'll merge it and release it. 👍
from highline.
Released https://rubygems.org/gems/highline/versions/2.0.0.pre.develop.14
from highline.
Related Issues (20)
- Docs not on RubyDoc.info as README states HOT 2
- Proc validation displays ruby object on invalid HOT 8
- undefined method 'default_instance' HOT 3
- Default Highline Example on GithubGives Error HOT 5
- HighLine Terminal::IOConsole#restore_mode does not work with StringIO HOT 3
- System extensions depend on now-internalized JRuby dependencies HOT 14
- consider exposing Readline.completion_proc via HighLine::Question#selection HOT 3
- default value has to be a string HOT 14
- Ctrl-C improperly handled when q.echo = false HOT 6
- Issues with echo: false and not on TTY HOT 7
- Can't get terminal_size HOT 11
- echo=false or echo='*' requires extra character after enter on Windows HOT 6
- Possible to accept multiple selections with `.in` and `.default`? HOT 5
- test failing when ruby is built against libedit instead of readline HOT 3
- Have to set convert type in order for `.in` to work with array
- 2.1.0 was released, but tag is missing in repository HOT 2
- Make Highline Ruby 3.3 and reline compatible HOT 1
- Update tests for Reline (as the substitute of Readline)
- Add `abbrev` to gemspec HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from highline.