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

vi style editing in JLine3 #821

Closed
user3477071 opened this issue Jan 26, 2023 · 2 comments · Fixed by #882
Closed

vi style editing in JLine3 #821

user3477071 opened this issue Jan 26, 2023 · 2 comments · Fixed by #882
Labels

Comments

@user3477071
Copy link

As per
#230
inputrc support has been removed from JLine3.

The jshell command that is part of JDK uses JLine3 for line editing.

Is it possible to enable vi style line editing on the jshell command
through a configuration file used by JLine3?

@gnodet
Copy link
Member

gnodet commented Mar 2, 2023

Note that InputRC support has been somewhat added back in #230 with https://github.com/jline/jline3/blob/jline-parent-3.22.0/builtins/src/main/java/org/jline/builtins/InputRC.java, though it's not called automatically.

Unfortunately, the jshell tool does not seem to allow any external configuration, looking at https://github.com/openjdk/jdk/blob/master/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java.

@gnodet gnodet added the question label Mar 2, 2023
@user3477071
Copy link
Author

As per jshell docs at

https://docs.oracle.com/en/java/javase/17/jshell/editing.html

Shell editing in JShell is built on JLine, which is functionally similar to BSD editline and GNU readline in Emacs mode.

If GNU readline in Emacs mode can be supported by JLine notwithstanding the limitation of

Unfortunately, the jshell tool does not seem to allow any external configuration, looking at https://github.com/openjdk/jdk/blob/master/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java.

it is not clear why GNU readline in vi mode also be supported in similar fashion.

Can JLine enable GNU readline in vi mode when $HOME/.inputrc is present?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants