Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge ConsoleUI to provide interactive menus #841

Closed
MTyson opened this issue Apr 21, 2023 · 12 comments
Closed

Merge ConsoleUI to provide interactive menus #841

MTyson opened this issue Apr 21, 2023 · 12 comments
Labels
Milestone

Comments

@MTyson
Copy link
Contributor

MTyson commented Apr 21, 2023

I want to achieve an effect like so: https://www.npmjs.com/package/prompt-checkbox

But in Java. (C'mon Java, you can do it).

@mattirn
Copy link
Collaborator

mattirn commented Apr 22, 2023

Yes, you can do it also in java... See #592 and my old pull request Upgrade JLine to 3.19.0 awegmann/consoleui#24, which IMHO is working pretty well.

@MTyson
Copy link
Contributor Author

MTyson commented Apr 22, 2023

Nice, thanks. Does this attempt things like https://www.npmjs.com/package/inquirer, meaning, arrow key navigable select/multi-select?
I've tried about half a dozen java libs and they all end up just being "menus" that select by means of typing in the option letter/num.

@MTyson
Copy link
Contributor Author

MTyson commented Apr 22, 2023

It looks like it does indeed. What is the quickest path to take from a vanilla JLine app to an app that can offer interactive menu prompts?

@lutzseverino
Copy link

I'm pretty confused right now, can someone point me in the right direction on (preferably) an explanation on how to do these sorts of things? As I understand, JLine is capable of reading UP, DOWN, and such keystrokes, I just cannot for the life of me get it to work!

@MTyson
Copy link
Contributor Author

MTyson commented Apr 22, 2023

My superficial understanding is that the JLine library does not handle single keystrokes but you can add a layer that will respond that way. I think the second comment above demonstrates how to do that in the links. Still looking.

@MTyson
Copy link
Contributor Author

MTyson commented Apr 22, 2023

I'm actually writing a piece for InfoWorld on JLine, and I was hoping to include some fancy menu handling but I think I'll just go with entering text and hitting the enter key.

@MTyson
Copy link
Contributor Author

MTyson commented Apr 22, 2023

I just got to look at ConsoleUI - it does exactly what we want. Thanks @mattirn @awegmann.

@gnodet gnodet closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2023
@lutzseverino
Copy link

lutzseverino commented Jan 18, 2024

So, to clear everything up: JLine doesn't provide this functionality on its own. Why did #24 never get merged?

@gnodet
Copy link
Member

gnodet commented Jan 18, 2024

So, to clear everything up: JLine doesn't provide this functionality on its own. Why did #24 never get merged?

That's not for us to answer. I suppose the project is not maintained anymore... However, if there's a will and if @awegmann is ok, we could merge ConsoleUI into a new JLine module and shut down the ConsoleUI project.

@awegmann
Copy link
Contributor

awegmann commented Jan 18, 2024

Hi everybody. Mea culpa. ConsoleUI is not really maintained anymore from my side. I would be pleased, if the project can live directly with JLine.
When I started ConsoleUI using JLine2 was the way to go, but the way I caught the keystrokes also felt a bit awkward. I knew, that JLine was not designed to allow this kind of usage.
Which jline3 this part of the code also had to be changed. If ConsoleUI were a part of JLine, the integration would benefit.
To answer your question, Guillaume: yes, I would like ConsoleUI to live its life in your project.

@gnodet
Copy link
Member

gnodet commented Jan 18, 2024

Hi everybody. Mea culpa. ConsoleUI is not really maintained anymore from my side. I would be pleased, if the project can live directly with JLine. When I started ConsoleUI using JLine2 was the way to got, but the way I caught the keystrokes also felt a bit awkward. I knew, that JLine was not designed to allow this kind of usage. Which jline3 this part of the code also had to be changed. If ConsoleUI were a part of JLine, the integration would benefit. To answer your question, Guillaume: yes, I would like ConsoleUI to live its life in your project.

Ok, thx for the quick reply !

@mattirn @lutzseverino do you want to take a look at creating a PR to merge ConsoleUI into JLine in a new module ?

@gnodet gnodet reopened this Jan 18, 2024
@mattirn
Copy link
Collaborator

mattirn commented Jan 19, 2024

Ok, I can do a PR.

@gnodet gnodet changed the title Interactive menus: possible? Merge ConsoleUI to provide interactive menus Feb 27, 2024
@gnodet gnodet added this to the 3.26.0 milestone Feb 27, 2024
@gnodet gnodet closed this as completed in 9c53282 Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants