Skip to content

Commit

Permalink
Add a public way to identify dumb terminals.
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Nov 4, 2016
1 parent f4cf2a2 commit 380584c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/main/java/org/jline/terminal/Terminal.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
*/
public interface Terminal extends Closeable, Flushable {

/**
* Type used for dumb terminals.
*/
String TYPE_DUMB = "dumb";

String getName();

//
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jline/terminal/impl/DumbTerminal.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class DumbTerminal extends AbstractTerminal {
private final Size size;

public DumbTerminal(InputStream in, OutputStream out) throws IOException {
this("dumb", "ansi", in, out, Charset.defaultCharset().name());
this(TYPE_DUMB, "ansi", in, out, Charset.defaultCharset().name());
}

public DumbTerminal(String name, String type, InputStream in, OutputStream out, String encoding) throws IOException {
Expand Down

0 comments on commit 380584c

Please # to comment.