Skip to content

Upgrade JLine to 3.19.0 - #24

Open
mattirn wants to merge 4 commits into
awegmann:masterfrom
mattirn:jline3
Open

mattirn wants to merge 4 commits into
awegmann:masterfrom
mattirn:jline3

Conversation

@mattirn

@mattirn mattirn commented Feb 3, 2021 •

Copy link
Copy Markdown

Removed ConsoleReaderImpl, CUIRenderer and *Prompt classes. New implementation removed also compile dependency of Jansi jar. PromptBuilder works as before.

Two new modules:

  1. Rewritten ConsolePrompt
    In addition to the prompt() method it includes also class UiConfig for ConsoleUI configurations.
  2. Rewritten AbstractPrompt
    Contains classes for all prompt implementations and methods for rendering. Implementation uses JLine BindingReader to read terminal input and Display to write output. Highlighting is done using AttributedStringBuilder class.

Features that are not available in this pull request:
1. tab completion. This require implementation in consoleui.
2. not possible to set page sizes for long lists. If the list does not fit to the terminal a broken list will be created. This should be relatively easy to resolve.

New features:

  1. color configuration using UI_COLORS environment variable. Details see class UiConfig and JLine wiki. JLine extended format with true color support will be available in JLine version 3.19.1.
  2. cursor pointer and checkbox configuration, see details in UiConfig class.

I have tested a new implementation in Linux, Windows 10 CMD and gitbash.

@awegmann

awegmann commented Feb 3, 2021

Copy link
Copy Markdown
Owner

Wow. It looks like a big step forward for ConsoleUI. I started a jline3 port months ago but didn't finish it. I think I mainly struggled because of some classes only poorly documented that are important to use in ConsoleUI. Let me review and test again (a bit) before the merge.
What was the intention to update ConsoleUI for you? Looks like you are a jline3 contributor?

@mattirn

mattirn commented Feb 4, 2021

Copy link
Copy Markdown
Author

Initially I was going to implement a fix for jline/jline3#592 in JLine. Then looking around I found ConsoleUI and ended up to write this pull request. In future I might use ConsoleUI also in my JLine powered CLI.

@mattirn
mattirn force-pushed the jline3 branch 2 times, most recently from 95edf26 to 5ec4f88 Compare February 6, 2021 22:12
@awegmann

Copy link
Copy Markdown
Owner

Hi.
Sorry, for the late reply to your pull request.
I merged your pull request to a new branch to test a little bit. With the completers I have problems with cursor navigation on my Mac (iTerm). It looks like that up and down keys are not recognized correctly.
Interresting - cursor keys when navigating in the ConsoleUI lists work as expected.
There are some other minor things in cursor movement to fix. I will dig a little deeper into this...

@MTyson

MTyson commented Apr 22, 2023

Copy link
Copy Markdown
Contributor

OK, what can I do to help out here, this is a great project. I want to see it keep going.

@awegmann

Copy link
Copy Markdown
Owner

Sorry, for not releasing a new version with the jline3 support. I promise, I will resume work on this in the coming days.
For the question about menus: do you think about a simple one-menu-as-input, or a full-fledged hierarchical menu system?

@roniel-rhack

Copy link
Copy Markdown

Sorry, for not releasing a new version with the jline3 support. I promise, I will resume work on this in the coming days. For the question about menus: do you think about a simple one-menu-as-input, or a full-fledged hierarchical menu system?

Hey @awegmann, i found this great library and I wanna use it for some cli projects but I need a jline 3 support

Are you going to release a new version?

@awegmann

Copy link
Copy Markdown
Owner

Sorry, for not releasing a new version with the jline3 support. I promise, I will resume work on this in the coming days. For the question about menus: do you think about a simple one-menu-as-input, or a full-fledged hierarchical menu system?

Hey @awegmann, i found this great library and I wanna use it for some cli projects but I need a jline 3 support

Are you going to release a new version?

Hi Roniel.

ConsoleUI will be part of jline3 starting with the next release. https://github.com/jline/jline3/milestone/52

But I don't know when this will be released.

Regards,
Andreas

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants