Tabnine Logo
WindowsAnsiOutputStream.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.fusesource.jansi.WindowsAnsiOutputStream
constructor

Best Java code snippets using org.fusesource.jansi.WindowsAnsiOutputStream.<init> (Showing top 10 results out of 315)

origin: jline/jline

/**
 * Returns an ansi output stream handler. We return whatever was
 * passed if we determine we cannot handle ansi based on Kernel32 calls.
 * 
 * @return an @{link AltWindowAnsiOutputStream} instance or the passed 
 * stream.
 */
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.
    return new AnsiOutputStream(stream);
  }
  return stream;
}
origin: locationtech/geogig

public boolean checkAnsiSupported(OutputStream out, String osName) throws Throwable {
  if (out != System.out) {
    return false;
  }
  if (osName.startsWith("windows") && osName.endsWith("10")) {
    new WindowsAnsiOutputStream(out);
  } else if (osName.startsWith("windows") && !osName.endsWith("10")) {
    return false;
  }
  if (System.console() == null) {
    return false;
  }
  return true;
}
origin: org.locationtech.geogig/geogig-cli-core

public boolean checkAnsiSupported(OutputStream out, String osName) throws Throwable {
  if (out != System.out) {
    return false;
  }
  if (osName.startsWith("windows") && osName.endsWith("10")) {
    new WindowsAnsiOutputStream(out);
  } else if (osName.startsWith("windows") && !osName.endsWith("10")) {
    return false;
  }
  if (System.console() == null) {
    return false;
  }
  return true;
}
origin: org.locationtech.geogig/geogig-cli

public boolean checkAnsiSupported(OutputStream out, String osName) throws Throwable {
  if (out != System.out) {
    return false;
  }
  if (osName.startsWith("windows") && osName.endsWith("10")) {
    new WindowsAnsiOutputStream(out);
  } else if (osName.startsWith("windows") && !osName.endsWith("10")) {
    return false;
  }
  if (System.console() == null) {
    return false;
  }
  return true;
}
origin: org.aesh/aesh-readline

public WinSysTerminal(String name, boolean nativeSignals, SignalHandler signalHandler) throws IOException {
  super(setVTMode(), new WindowsAnsiOutputStream(new FileOutputStream(FileDescriptor.out)), name, nativeSignals, signalHandler);
}
origin: org.jboss.jreadline/jreadline

@Override
public void init(InputStream inputStream, OutputStream stdOut, OutputStream stdErr) {
  if(inputStream == System.in) {
    System.out.println("Using System.in");
  }
  //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)));
  }
  this.input = inputStream;
}
origin: org.scala-lang/jline

/**
 * Returns an ansi output stream handler. We return whatever was
 * passed if we determine we cannot handle ansi based on Kernel32 calls.
 *
 * @return an @{link AltWindowAnsiOutputStream} instance or the passed
 * stream.
 */
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.
    return new AnsiOutputStream(stream);
  }
  return stream;
}
origin: com.typesafe.sbt/incremental-compiler

/**
 * Returns an ansi output stream handler. We return whatever was
 * passed if we determine we cannot handle ansi based on Kernel32 calls.
 * 
 * @return an @{link AltWindowAnsiOutputStream} instance or the passed 
 * stream.
 */
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.
    return new AnsiOutputStream(stream);
  }
  return stream;
}
origin: com.tngtech.jgiven/jgiven-core

  return new WindowsAnsiOutputStream( stream );
} catch( Throwable ignore ) {
origin: org.fusesource.jansi/jansi

  return new WindowsAnsiOutputStream(stream);
} catch (Throwable ignore) {
org.fusesource.jansiWindowsAnsiOutputStream<init>

Popular methods of WindowsAnsiOutputStream

  • applyAttribute
  • applyCursorPosition
  • getConsoleInfo
  • invertAttributeColors

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • getSupportFragmentManager (FragmentActivity)
  • setRequestProperty (URLConnection)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now