Skip to content

Commit

Permalink
Merge remote-tracking branch 'dblock/readme-colors'
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Mar 15, 2017
2 parents a8cda38 + a7d31fe commit 1e70152
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ will do one of the following with the ANSI escape codes that it receives:
Enabling the Jansi ANSI support into your application is as simple as doing a
simple static method call:

import org.fusesource.jansi.AnsiConsole;
...
AnsiConsole.systemInstall();
``` java
import org.fusesource.jansi.AnsiConsole;
...
AnsiConsole.systemInstall();
```

Disabling it is also done via a static method:

AnsiConsole.systemUninstall();
``` java
AnsiConsole.systemUninstall();
```

It is safe to call those methods multiple times, they keep track of how many
times `systemInstall()` has been called and only uninstalls when the
Expand All @@ -58,10 +62,10 @@ times `systemInstall()` has been called and only uninstalls when the
Using the Ansi escape sequence builder:

```java
import static org.fusesource.jansi.Ansi.*;
import static org.fusesource.jansi.Ansi.Color.*;
...
System.out.println( ansi().eraseScreen().fg(RED).a("Hello").fg(GREEN).a(" World").reset() );
import static org.fusesource.jansi.Ansi.*;
import static org.fusesource.jansi.Ansi.Color.*;
...
System.out.println( ansi().eraseScreen().fg(RED).a("Hello").fg(GREEN).a(" World").reset() );
```

The above will clear the screen, write `Hello` in red and `World` in green,
Expand All @@ -72,7 +76,7 @@ But there is an even simpler way to accomplish the above using the `render`
method:

```java
System.out.println( ansi().eraseScreen().render("@|red Hello|@ @|green World|@") );
System.out.println( ansi().eraseScreen().render("@|red Hello|@ @|green World|@") );
```

## Windows XP Users
Expand Down

0 comments on commit 1e70152

Please sign in to comment.