Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Do not depend on console to properly encode to proper tty-friendly ch…

…ars on windows if the JVM was started without a console.
  • Loading branch information...
commit cfee0e7de6a7c2ddfa724cdc238831395394404b 1 parent cde69f8
@enebo enebo authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  core/src/main/java/org/jruby/RubyIO.java
View
2  core/src/main/java/org/jruby/RubyIO.java
@@ -1464,7 +1464,7 @@ protected int fwrite(RubyString buffer) {
// console() can detect underlying windows codepage so we will just write to it
// and hope it is legible.
- if (Platform.IS_WINDOWS && tty_p(getRuntime().getCurrentContext()).isTrue()) {
+ if (Platform.IS_WINDOWS && tty_p(getRuntime().getCurrentContext()).isTrue() && System.console() != null) {
System.console().printf("%s", buffer.asJavaString());
return len;
}
Please sign in to comment.
Something went wrong with that request. Please try again.