-
Notifications
You must be signed in to change notification settings - Fork 425
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
Avoid calling stty
when ANSICON is set
#1104
Comments
There is also some information here https://conemu.github.io/en/AnsiEscapeCodes.html#Environment_variable. It looks like this is only set if you have ANSI codes enabled? |
Started to happen on JDK 22-ea in JUnit's integration tests: junit-team/junit5#3419 Underlying change in JDK 22-ea+8 is:
Could this new method help to decide whether to unconditionally call |
I created https://github.com/sormuras/JDK-8313893 to reproduce this issue. Seems like Picocli 4.7.x (used in JUnit 5.9 and higher) introduced the |
Yes, I think so. FWIW, I tried |
This is a follow-up ticket for #1103 based on @dwalluck's suggestion.
When running the picocli tests on Cygwin/ConEmu, the following output is generated:
Picocli internally calls
stty -a -F /dev/tty
in a separate process when theusageHelpAutoWidth=true
to determine the window width. In a non-interactive session, that may result in the above output. The problem is, that from Java, the only way to detect whether the process is connected to a terminal is to see ifSystem.console()
returnsnull
, and since Cygwin and MSYS use a pseudo-tty, the console is alwaysnull
in these environments...@dwalluck pointed out that
Example
ANSICON
value:80x1000 (80x25)
. (See also the Ansicon Manual.)One idea to avoid the "No such device or address" output is to get the terminal window width from the
ANSICON
value if available instead of unconditionally callingstty -a -F /dev/tty
.The text was updated successfully, but these errors were encountered: