Skip to content

Replace jline dependency with aesh-readline terminal-tty #2502

Description

@stalep

With the picocli-to-aesh migration (#2453), jbang already depends on aesh's terminal-api module. The terminal-tty module from aesh-readline provides the same terminal capabilities that jline is currently used for.

Current jline usage

jline is used in 3 files for the interactive deps search TUI:

  • Deps.java -- Terminal + TerminalBuilder for system terminal creation
  • ArtifactSearchWidget.java -- Terminal, AttributedString, AttributedStyle, Capability for styled interactive search UI
  • ComboBox.java -- BindingReader, KeyMap, Terminal, AttributedString, Capability for interactive combobox with key bindings

aesh-readline equivalents

jline aesh-readline
Terminal / TerminalBuilder Connection / PosixSysTerminal / WinSysTerminal (terminal-tty)
AttributedString / AttributedStyle TerminalString / TerminalColor / TerminalTextStyle (terminal-api)
InfoCmp.Capability Capability (terminal-api)
BindingReader / KeyMap Key (terminal-api) + readline action mappings
Signal Signal (terminal-api)
Attributes Attributes (terminal-api)

Benefits

  • Remove jline dependency (jline-console-ui, jline-terminal-jni, and their transitives)
  • Reduce jar size
  • Single terminal framework instead of two
  • Better native image support (aesh-readline is designed for it)

Dependencies to add

implementation 'org.aesh:terminal-tty:3.8'  // or whatever version matches

Dependencies to remove

implementation "org.jline:jline-console-ui:$jlineVersion"
implementation "org.jline:jline-terminal-jni:$jlineVersion"

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions