-
Notifications
You must be signed in to change notification settings - Fork 219
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
TerminalBuilder.system(false).dumb(true) does not give a DumbTerminal. Is this working as intended? #979
Comments
The The ansi sequences appearing with a dumb terminal should be fixed, so do not hesitate to raise issues for those. What's your use case exactly ? You usually don't really always want a dumb terminal... |
My CLI can be used in interactive mode or be fed a file When I see that System.console() == null, I assume that the cli is reading from a file. So I try to use a dumb terminal. This is because when I started using JLine 3, other terminals would print console codes in the output file. I also had to set terminal.setSize(10000,10000) so that even dumb terminal does not output control codes when reaching the end of the supposed screen. Now that dumb terminal is always a system terminal, it is now ignoring the size I set. I am seeing console codes in the output file. Is there a terminal which knows if we are reading from and/or writing to a file, and disables all control characters ? PS: As a separate issue, I see that JLine behaves badly when size is set to (0,0). This is possible if stty is set up badly and returns lines 0 columns 0. JLine should assume sane values (maybe 24,80) when it sees invalid values like (0,0) . I think the code is ExecPty.getSize(), but I havent tested a fix. I also see some issues with JLine on serial port like ttyS0 , Do you have a system where you can test ttyS0 ? |
The TerminalBuilder is supposed to handle that. It will create a real terminal if the input stream is connected to the terminal and if either the output or error stream is connected. On output, you can force the selection by configuring
The dumb terminal is supposed to. Anything else is a bug.
Ok, that may need a fix too.
Not sure how I could do that... |
Jline version 3.26.1
JDK : 11.0.23
Java code:
Execute:
Note: I will get a DumbTerminal if I set system(true), but then I get occasional terminal codes in the output.
The text was updated successfully, but these errors were encountered: