Search code examples
javalog4jjline

JLine autocomplete not showing and running onComplete after pressing enter


For some reason, my multithreaded netty server won't work with autocomplete on Windows to be specific (in my original testing linux worked fine) I found terminal console appender and jansi to be "solutions" which they were for a lot of problems, except this one. The odd part about this is my client running the same code function to call lineReader.readLine("> "); works perfectly fine with auto complete with almost exact same code. I have no idea what is the problem because they're both calling the same code at the same order with the same dependencies (except some server-side dependencies)

Source at: https://github.com/Fernthedev/light-chat

Server read code: https://github.com/Fernthedev/light-chat/blob/master/java/server/src/main/java/com/github/fernthedev/server/ServerCommandHandler.java

Client read code: https://github.com/Fernthedev/light-chat/blob/master/java/client/src/main/java/com/github/fernthedev/client/WaitForCommand.java

StaticHandler (used for reading and setting terminal and reader): https://github.com/Fernthedev/light-chat/blob/master/java/universalChat/src/main/java/com/github/fernthedev/universal/StaticHandler.java

Both server and client have a main class with the main(String[] args) method


Solution

  • I narrowed the problem being forcing TerminalConsoleAppender to make a dumb terminal so I disabled that and then fully shading jline and jline-terminal-jansi and worked perfectly.