Package org.fusesource.jansi

Examples of org.fusesource.jansi.WindowsAnsiOutputStream


    @Override
    public void init(InputStream inputStream, OutputStream stdOut, OutputStream stdErr) {
        //setting up reader
        try {
            //AnsiConsole.systemInstall();
            this.stdOut = new PrintWriter( new OutputStreamWriter(new WindowsAnsiOutputStream(stdOut)));
            this.stdErr = new PrintWriter( new OutputStreamWriter(new WindowsAnsiOutputStream(stdErr)));
        }
        catch (Exception ioe) {
            this.stdOut = new PrintWriter( new OutputStreamWriter(new AnsiOutputStream(stdOut)));
            this.stdErr = new PrintWriter( new OutputStreamWriter(new AnsiOutputStream(stdErr)));
        }
View Full Code Here


    public void init(Settings settings) {
        this.settings = settings;
        //setting up reader
        try {
            //AnsiConsole.systemInstall();
            this.stdOut = new PrintStream( new WindowsAnsiOutputStream(settings.getStdOut()), true);
            this.stdErr = new PrintStream( new WindowsAnsiOutputStream(settings.getStdErr()), true);
        }
        catch (Exception ioe) {
            this.stdOut = new PrintStream( new AnsiOutputStream(settings.getStdOut()), true);
            this.stdErr = new PrintStream( new AnsiOutputStream(settings.getStdErr()), true);
        }
View Full Code Here

    public void init(Settings settings) {
        this.settings = settings;
        //setting up reader
        try {
            //AnsiConsole.systemInstall();
            this.stdOut = new PrintStream( new WindowsAnsiOutputStream(settings.getStdOut()), true);
            this.stdErr = new PrintStream( new WindowsAnsiOutputStream(settings.getStdErr()), true);

        }
        catch (Exception ioe) {
            this.stdOut = new PrintStream( new AnsiOutputStream(settings.getStdOut()), true);
            this.stdErr = new PrintStream( new AnsiOutputStream(settings.getStdErr()), true);
View Full Code Here

public class WindowsConsoleDetector implements ConsoleDetector {
    public ConsoleMetaData getConsole() {
        // Use Jansi's detection mechanism
        try {
            new WindowsAnsiOutputStream(new ByteArrayOutputStream());
            return new FallbackConsoleMetaData();
        } catch (IOException ignore) {
            // Not attached to a console
            return null;
        }
View Full Code Here

     */
    private static OutputStream wrapOutputStream(final OutputStream stream) {
        if (Configuration.isWindows()) {
            // On windows we know the console does not interpret ANSI codes..
            try {
                return new WindowsAnsiOutputStream(stream);
            } catch (Throwable ignore) {
                // this happens when JNA is not in the path.. or
                // this happens when the stdout is being redirected to a file.
            }
            // Use the ANSIOutputStream to strip out the ANSI escape sequences.
View Full Code Here

    private static OutputStream wrapOutputStream(final OutputStream stream) {
        String os = System.getProperty("os.name");
        if( os.startsWith("Windows") ) {
            // On windows we know the console does not interpret ANSI codes..
            try {
                return new WindowsAnsiOutputStream(stream);
            } catch (Throwable ignore) {
                // this happens when JNA is not in the path.. or
                // this happens when the stdout is being redirected to a file.
            }
            // Use the ANSIOutputStream to strip out the ANSI escape sequences.
View Full Code Here

TOP

Related Classes of org.fusesource.jansi.WindowsAnsiOutputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.