Search in sources :

Example 1 with TerminalBuilder

use of org.jline.terminal.TerminalBuilder in project jPOS by jpos.

the class CLI method buildTerminal.

private Terminal buildTerminal(InputStream in, OutputStream out) throws IOException {
    TerminalBuilder builder = TerminalBuilder.builder();
    builder.streams(in, out).system(System.in == in);
    Terminal t = builder.build();
    Attributes attr = t.getAttributes();
    attr.getOutputFlags().addAll(EnumSet.of(Attributes.OutputFlag.ONLCR, Attributes.OutputFlag.OPOST));
    t.setAttributes(attr);
    return t;
}
Also used : Attributes(org.jline.terminal.Attributes) Terminal(org.jline.terminal.Terminal) TerminalBuilder(org.jline.terminal.TerminalBuilder)

Aggregations

Attributes (org.jline.terminal.Attributes)1 Terminal (org.jline.terminal.Terminal)1 TerminalBuilder (org.jline.terminal.TerminalBuilder)1