-
Feature Request
-
Resolution: Done
-
Major
-
0.66.10
-
None
My use case is that I'm only using Aesh for injecting command line arguments, and structuring command classes. I need to control all error output to stdout / stderr, and I need to exit java process with error code when an error occurs. In essence - I only do one REPL cycle, and exit.
Currently the only way to set a custom AeshConsoleCallback is to get a private 'console' field on AeshConsoleImpl, and calling Console.setConsoleCallback() on it. That requires reflection hacks.
Field field = AeshConsoleImpl.class.getDeclaredField("console"); field.setAccessible(true); Console internalConsole = (Console) field.get(console); internalConsole.setConsoleCallback(new MyAeshConsoleCallbackImpl(console));