[Git][java-team/jansi][upstream] 2 commits: New upstream version 1.17
Emmanuel Bourg
gitlab at salsa.debian.org
Sat Feb 16 08:32:42 GMT 2019
Emmanuel Bourg pushed to branch upstream at Debian Java Maintainers / jansi
Commits:
d6898071 by Emmanuel Bourg at 2018-06-13T12:46:29Z
New upstream version 1.17
- - - - -
fdb19f4f by Emmanuel Bourg at 2018-06-13T12:48:09Z
New upstream version 1.17.1
- - - - -
24 changed files:
- changelog.md
- example/pom.xml
- jansi-website/ext/Website.scala
- jansi-website/pom.xml
- jansi-website/src/community/contributing.page
- jansi-website/src/community/developers.page
- jansi-website/src/community/faq.page
- jansi-website/src/community/source.page
- jansi-website/src/download.page
- jansi/pom.xml
- jansi/src/main/java/org/fusesource/jansi/Ansi.java
- jansi/src/main/java/org/fusesource/jansi/AnsiConsole.java
- + jansi/src/main/java/org/fusesource/jansi/AnsiMain.java
- jansi/src/main/java/org/fusesource/jansi/AnsiOutputStream.java
- + jansi/src/main/java/org/fusesource/jansi/AnsiPrintStream.java
- + jansi/src/main/java/org/fusesource/jansi/FilterPrintStream.java
- jansi/src/main/java/org/fusesource/jansi/WindowsAnsiOutputStream.java
- + jansi/src/main/java/org/fusesource/jansi/WindowsAnsiPrintStream.java
- + jansi/src/main/resources/org/fusesource/jansi/jansi.txt
- − jansi/src/test/java/org/fusesource/jansi/AnsiConsoleExample3.java
- jansi/src/test/java/org/fusesource/jansi/AnsiStringTest.java
- + jansi/src/test/java/org/fusesource/jansi/FilterPrintStreamTest.java
- jansi/src/test/java/org/fusesource/jansi/HtmlAnsiOutputStreamTest.java
- pom.xml
Changes:
=====================================
changelog.md
=====================================
@@ -1,8 +1,57 @@
# 
-## [Jansi 1.16][1_16], released 2017-05-xx
-[1_16]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.16
-
+<!-- git log --pretty=format:'* [`%h`](https://github.com/fusesource/jansi/commit/%H) %s' -->
+
+## [Jansi 1.17.1][1_17_1],
+[1_17_1]: https://repo.maven.apache.org/maven2/org/fusesource/jansi/jansi/1.17.1
+
+* [`73c621f`](https://github.com/fusesource/jansi/commit/73c621ff7f2d0fd8c7e5c23a814359c34fdab012) on MSYSTEM=MINGW, only BASH is natively ANSI aware, not Git CMD #119
+* [`48b0be5`](https://github.com/fusesource/jansi/commit/48b0be5eaa8a0b2cb8d27173d902d1da5f3ba9d6) improved diagnostic output
+* [`68c5810`](https://github.com/fusesource/jansi/commit/68c5810336c606e938c0b70409276c3f53e3b568) Javadoc quick fix for warnings and errors
+* [`e45e466`](https://github.com/fusesource/jansi/commit/e45e4665538ba9234f5ee5d7b06d78d6a03deda3) Synchronization to protect against problems while analyzing Ansi codes resulting from multithreading
+* [`0645365`](https://github.com/fusesource/jansi/commit/06453651594188403f28614097c8598c3bf387e6) update changelog.md for 1.17 release
+* [`cd34211`](https://github.com/fusesource/jansi/commit/cd342119ced2e348245d6cb59990401f382ffbe6) Pass RESET_CODE via filter while closing PrintStream
+* [`14b601c`](https://github.com/fusesource/jansi/commit/14b601ccaa4a24a5554407a8bc7faf45b43b622f) prepare Jansi 1.17 site
+
+## [Jansi 1.17][1_17], released 2018-02-02
+[1_17]: https://repo.maven.apache.org/maven2/org/fusesource/jansi/jansi/1.17
+
+* [`74c300d`](https://github.com/fusesource/jansi/commit/74c300d4d14d18d33876f4daca937adec91f5e13) Upgrade to hawtjni 1.16
+* [`3f47f7e`](https://github.com/fusesource/jansi/commit/3f47f7e36d49c4a42d51d04a682382f8450fefdc) Upgrade to jansi-native 1.8
+* [`2964a2f`](https://github.com/fusesource/jansi/commit/2964a2fbb50525cf8571a5a04e8363c8f131015d) deprecated WindowsAnsiOutputStream: use WindowsAnsiPrintStream
+* [`8447fda`](https://github.com/fusesource/jansi/commit/8447fdafb0426a02cc1f9117ff34d7f80bd81ab1) optimization: use valueOf instead of constructor
+* [`6251669`](https://github.com/fusesource/jansi/commit/62516698e86e0c6d55f3f9174c93f4943f1aed2f) added info on native library location and auto-extract
+* [`007b935`](https://github.com/fusesource/jansi/commit/007b93526da79a6601107e1f6270d8e2cbb0c3a4) fixed typos
+* [`346b788`](https://github.com/fusesource/jansi/commit/346b788d7f6d57f29319161157ceb481d72cfe70) added jansi-native API docs
+* [`259700a`](https://github.com/fusesource/jansi/commit/259700a4daf9859a42bedf76c4df1159955c8a5f) 3.0.0 is not released yet...
+* [`47e2e99`](https://github.com/fusesource/jansi/commit/47e2e99bd9afa0d88936b1c9f255dbf4fcc1db4e) removed duplicate line (already in include)
+* [`16d9210`](https://github.com/fusesource/jansi/commit/16d921095bdc2e93b05bf0db8beea69cacb4b18b) improved/fixed javadoc
+* [`4b24c09`](https://github.com/fusesource/jansi/commit/4b24c0928d8c233cd7dc7c7077ad4d4ddb82cb2e) Filter out escape sequence 'character set' select
+* [`5f8eb45`](https://github.com/fusesource/jansi/commit/5f8eb45b376c77b6f72b65b1afe485c322f49198) Correct support for the bright colors on windows - regression fix
+* [`5ac2049`](https://github.com/fusesource/jansi/commit/5ac2049c23e4d091bf48a531b450adfdb2d4ef7d) [#95](http://github.com/fusesource/jansi/issues/95) add comments on expected diffs between Print and Output Streams
+* [`40631bd`](https://github.com/fusesource/jansi/commit/40631bdf503473054eefd27b3c2301bfcbe9643d) Merge pull request [#95](http://github.com/fusesource/jansi/issues/95) from hboutemy/printstream
+* [`3b2eab6`](https://github.com/fusesource/jansi/commit/3b2eab623277d4e6f2dc3b9e355ed6bb9dbbf84f) Merge pull request [#99](http://github.com/fusesource/jansi/issues/99) from jycchoi/master
+* [`f7a84bf`](https://github.com/fusesource/jansi/commit/f7a84bf2e1dff352c83089282ff1b1aedc20f901) Merge pull request [#84](http://github.com/fusesource/jansi/issues/84) from hboutemy/website-1.16
+* [`5294c87`](https://github.com/fusesource/jansi/commit/5294c8728929f8c97c373141227242df8bfe7e1b) Correct support for the bright colors on windows - regression fix
+* [`d340856`](https://github.com/fusesource/jansi/commit/d340856e78925269ecc76cd16c29850fa9ca01e0) add AnsiPrintStream and FilterPrintStream to avoid encoding issues
+* [`769ebe0`](https://github.com/fusesource/jansi/commit/769ebe03655169b2eb380600912a55ac88b13efb) Merge pull request [#86](http://github.com/fusesource/jansi/issues/86) from hboutemy/javadoc
+* [`3ce6987`](https://github.com/fusesource/jansi/commit/3ce698726b353dd06acaa76777c6c2451415b850) Merge pull request [#92](http://github.com/fusesource/jansi/issues/92) from pmhahn/parse-sgr0
+* [`29dff3c`](https://github.com/fusesource/jansi/commit/29dff3cb48615c3d480cd400774d69ce724a9b84) Merge pull request [#88](http://github.com/fusesource/jansi/issues/88) from hboutemy/executable
+* [`b11eb3e`](https://github.com/fusesource/jansi/commit/b11eb3e421bff15e22cbc650256ed8f707b57fd9) added basic color rendering tests
+* [`cf69386`](https://github.com/fusesource/jansi/commit/cf69386f4010a05b5b122195957dd7f09b0d92ad) added explicit result of AnsiConsole system install on stdout&stderr
+* [`0484150`](https://github.com/fusesource/jansi/commit/0484150d01bc05e4f832fe6ee094fa7f46205338) diagnose isatty for both stdout and stderr
+* [`e35a57f`](https://github.com/fusesource/jansi/commit/e35a57f5fb17dbe3ac33040e436c12c96c613f81) 'isatty' check added to test
+* [`ef2d858`](https://github.com/fusesource/jansi/commit/ef2d858448215ef8639663c186653c501ddfb932) Filter out escape sequence 'character set' select
+* [`257b1de`](https://github.com/fusesource/jansi/commit/257b1de6336d3a6848e6739e958ee1d7bd77a712) added main class to jansi.jar to help diagnose issues or configs
+* [`f33497c`](https://github.com/fusesource/jansi/commit/f33497c0117b556e39fe806581e717292e6862ef) improved/fixed javadoc
+* [`b5a840e`](https://github.com/fusesource/jansi/commit/b5a840ecc600ed1cb6c3a9434e31b2d64c7d63cc) link to central for releases download
+* [`d3d8488`](https://github.com/fusesource/jansi/commit/d3d848848db654d756ade20bb0391422f31e9a05) prepared website publication for 1.16, with link to changelog
+
+## [Jansi 1.16][1_16], released 2017-05-04
+[1_16]: https://repo.maven.apache.org/maven2/org/fusesource/jansi/jansi/1.16
+
+* [`65c537c`](https://github.com/fusesource/jansi/commit/65c537c00f57565b2794d57472ec24e36ac2420a) Upgrade to released versions of hawtjni and jansi-native
+* [`7746c55`](https://github.com/fusesource/jansi/commit/7746c55160eb1d5fa1e820c838e6d540380e8c66) Update changelog.md
* [`90fb161`](https://github.com/fusesource/jansi/commit/90fb1619323ae32f9ff5b982fdcbb8939d1970b2) Update changelog
* [`18368e3`](https://github.com/fusesource/jansi/commit/18368e3adfe77574e7201693df7c557f6a6ec717) Support insert / delete lines ansi sequences
* [`52fba5a`](https://github.com/fusesource/jansi/commit/52fba5a1d826893cee4c06c2d957e608a0dae70b) Fix inverted colors
@@ -28,7 +77,7 @@
* [`4702c58`](https://github.com/fusesource/jansi/commit/4702c58cfa41b544f8df85f505f4134f278f71b3) site enhancements for 1.15 release
## [Jansi 1.15][1_15], released 2017-03-17
-[1_15]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.15
+[1_15]: https://repo.maven.apache.org/maven2/org/fusesource/jansi/jansi/1.15
* [`1e70152`](https://github.com/fusesource/jansi/commit/1e701521ac6a4dec202a3dcf608744724dbb3e06) Merge remote-tracking branch 'dblock/readme-colors'
* [`a8cda38`](https://github.com/fusesource/jansi/commit/a8cda38de363ac11d6a422a1838a5c372e1e0e21) Code cleanup
@@ -44,7 +93,7 @@
* [`38a24fa`](https://github.com/fusesource/jansi/commit/38a24fa29fa774719ea4a9a7a80797ec49a92aba) Avoid `processCursorDown` overflow on Y axis
## [Jansi 1.14][1_14], released 2016-10-04
-[1_14]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.14
+[1_14]: https://repo.maven.apache.org/maven2/org/fusesource/jansi/jansi/1.14
* [`eeda18c`](https://github.com/fusesource/jansi/commit/eeda18cb05122abe48b284dca969e2c060a0c009) Merge pull request [#59](http://github.com/fusesource/jansi/issues/59) from sschuberth/master
* [`b84df55`](https://github.com/fusesource/jansi/commit/b84df55b6c6a0688cf8ad790d4a3ac952ea6b9d0) Merge pull request [#65](http://github.com/fusesource/jansi/issues/65) from jbonofre/NATIVE_FIX
@@ -53,7 +102,7 @@
* [`fad337e`](https://github.com/fusesource/jansi/commit/fad337edcf1a58e2f9a0c0f329e74f9b608419c2) Improve fix for issue [#55](http://github.com/fusesource/jansi/issues/55). If we can't load that natives for any reason, fallback to better defaults.
## [Jansi 1.13][1_13], released 2016-06-15
-[1_13]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.13
+[1_13]: https://repo.maven.apache.org/maven2/org/fusesource/jansi/jansi/1.13
* [`a7ec77c`](https://github.com/fusesource/jansi/commit/a7ec77c0ad5cb05f8becdb035fd7fbac9992ae3e) Updating website bits.
* [`55c3817`](https://github.com/fusesource/jansi/commit/55c381767a2bd6f744f796c7b435afbf02c74a99) Merge pull request [#50](http://github.com/fusesource/jansi/issues/50) from sschuberth/master
@@ -70,7 +119,7 @@
* [`b9f61a2`](https://github.com/fusesource/jansi/commit/b9f61a235471253bdefabe7f8167d5271f247f39) Update readme.md
## [Jansi 1.12][1_12], released 2016-04-27
-[1_12]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.12
+[1_12]: https://repo.maven.apache.org/maven2/org/fusesource/jansi/jansi/1.12
* [`5d4eb66`](https://github.com/fusesource/jansi/commit/5d4eb665e428a63851ab2b51bad7c3487803e841) Fixing dep id.
* [`3949775`](https://github.com/fusesource/jansi/commit/3949775bb2df312d720fa22439efbea2b14e6ef4) Update parent pom.
@@ -103,23 +152,23 @@
* [`9bab505`](https://github.com/fusesource/jansi/commit/9bab505bfbd57c8511ef3641c6d0fe41c92302dd) Merge pull request [#19](http://github.com/fusesource/jansi/issues/19) from xuwei-k/patch-1
## [Jansi 1.11][1_11], released 2013-05-13
-[1_11]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.11
+[1_11]: https://repo.maven.apache.org/maven2/org/fusesource/jansi/jansi/1.11
* Upgraded to the latest hawtjni version.
## [Jansi 1.10][1_10], released 2013-03-25
-[1_10]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.10
+[1_10]: https://repo.maven.apache.org/maven2/org/fusesource/jansi/jansi/1.10
* Upgraded to the latest jansi native release (1.5).
## [Jansi 1.9][1_9], released 2012-06-04
-[1_9]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.9
+[1_9]: https://repo.maven.apache.org/maven2/org/fusesource/jansi/jansi/1.9
* Added HtmlAnsiOutputStream that converts ANSI output to HTML.
* Fixed handling of default text and background color.
## [Jansi 1.8][1_8], released 2012-02-15
-[1_8]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.8
+[1_8]: https://repo.maven.apache.org/maven2/org/fusesource/jansi/jansi/1.8
* Updated bundled native libraries:
* Windows: Added support for isatty and link against the system msvcrt.dll (so no need for VC redistributables).
@@ -127,39 +176,39 @@
* If the jansi.passthrough system property is set, then Jansi will not interpret any of the ANSI sequences.
## [Jansi 1.7][1_7], released 2011-09-21
-[1_7]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.7
+[1_7]: https://repo.maven.apache.org/maven2/org/fusesource/jansi/jansi/1.7
* Updated bundled native libraries:
* Windows: Adding support for PeekConsoleInputW, FlushConsoleInputBuffer so that CTRL-C can be handled by jline. Discarding mouse events on readConsoleInput.
* Linux: Built against glib 2.0 to be compatible with more versions of Linux.
## [Jansi 1.6][1_6], released 2011-06-19
-[1_6]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.6
+[1_6]: https://repo.maven.apache.org/maven2/org/fusesource/jansi/jansi/1.6
* Upgrade to HawtJNI 1.2 to pick up a fix to support 32 and 64 bit JVMs on a single machine.
* Add copy constructor for Ansi class.
* Port website doco to use Scalate instead of webgen.
## [Jansi 1.5][1_5], released 2010-11-04
-[1_5]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.5
+[1_5]: https://repo.maven.apache.org/maven2/org/fusesource/jansi/jansi/1.5
* Support for parsing Operating System Command (OSC) control sequences.
* Windows: added support for setting the console title through an OSC command, like on xterm.
* Added option to strip ANSI escapes if the 'jansi.strip' system property is set to true.
## [Jansi 1.4][1_4], released 2010-07-15
-[1_4]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.4
+[1_4]: https://repo.maven.apache.org/maven2/org/fusesource/jansi/jansi/1.4
* JNI libs are now bundled in the Jansi jar.
* Windows: added support for save and restore of cursor position, fixed bug in processCursorTo.
## [Jansi 1.3][1_3], released 2010-03-08
-[1_3]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.3
+[1_3]: https://repo.maven.apache.org/maven2/org/fusesource/jansi/jansi/1.3
* Switched to a HawtJNI generated native library instead of using JNA to access native functions.
## [Jansi 1.2.1][1_2_1], released 2010-03-08
-[1_2_1]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.2.1
+[1_2_1]: https://repo.maven.apache.org/maven2/org/fusesource/jansi/jansi/1.2.1
* Released to Maven Central.
=====================================
example/pom.xml
=====================================
@@ -3,7 +3,7 @@
<parent>
<artifactId>jansi-project</artifactId>
<groupId>org.fusesource.jansi</groupId>
- <version>1.16</version>
+ <version>1.17.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
=====================================
jansi-website/ext/Website.scala
=====================================
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2009-2017 the original author(s).
+ * Copyright (C) 2009-2018 the original author(s).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,10 +32,13 @@ object Website {
val project_forums_url= "http://groups.google.com/group/jansi"
val project_wiki_url= "https://github.com/fusesource/jansi/wiki"
val project_logo= "/images/project-logo.png"
- val project_version= "1.15"
- val project_snapshot_version= "1.16-SNAPSHOT"
+ val project_version= "1.17.1"
+ val project_snapshot_version= "1.18-SNAPSHOT"
val project_versions = List(
project_version,
+ "1.17",
+ "1.16",
+ "1.15",
"1.14",
"1.13",
"1.12",
=====================================
jansi-website/pom.xml
=====================================
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (C) 2009-2017 the original author(s).
+ Copyright (C) 2009-2018 the original author(s).
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
<parent>
<groupId>org.fusesource.jansi</groupId>
<artifactId>jansi-project</artifactId>
- <version>1.16-SNAPSHOT</version>
+ <version>1.17.1</version>
</parent>
<artifactId>jansi-website</artifactId>
@@ -225,6 +225,13 @@
<classifier>javadoc</classifier>
<outputDirectory>${basedir}/target/sitegen/documentation/api</outputDirectory>
</artifactItem>
+ <artifactItem>
+ <groupId>org.fusesource.jansi</groupId>
+ <artifactId>jansi-native</artifactId>
+ <version>${jansi-native-version}</version>
+ <classifier>javadoc</classifier>
+ <outputDirectory>${basedir}/target/sitegen/documentation/native-api</outputDirectory>
+ </artifactItem>
</artifactItems>
</configuration>
</execution>
=====================================
jansi-website/src/community/contributing.page
=====================================
@@ -26,8 +26,8 @@ We really want you to get involved in the ${project_name} project, to
[join the community](index.html) and help make it a better price of
software - please do dive in and help!
-Try surf the [documentation](../documentation/index.html) and website in
-general - if somethings confusing or not clear, [let us
+Try surf the [developer documentation](developers.html) and website in
+general - if something is confusing or not clear, [let us
know](index.html) or raise a [support request](support.html).
[Download](../download.html) the code and try it out and see what you think.
@@ -61,9 +61,6 @@ ensure that the problem stays fixed in future releases.
## Working on the code and creating patches
-We gladly accept patches if you can find ways to improve, tune or fix
-${project_name} in some way.
-
${include("/community/_creating_patches.ssp.md")}
## Becoming a committer
=====================================
jansi-website/src/community/developers.page
=====================================
@@ -33,5 +33,6 @@ Ready to start hacking on ${project_name}?
# API Reference
* [`jansi` API](../documentation/api/index.html)
+* [`jansi-native` API](../documentation/native-api/index.html)
Looking for the website documentation of a different ${project_name} [version](${website_base_url}/versions/index.html)?
=====================================
jansi-website/src/community/faq.page
=====================================
@@ -40,7 +40,7 @@ See the [support guide](support.html) for more details.
### How do I build ${project_name}?
First [get the source](source.html) then see the [building
-guide](building.html)
+guide](building.html): see [developer links](developers.html).
### How do I contribute or become a committer?
=====================================
jansi-website/src/community/source.page
=====================================
@@ -32,7 +32,6 @@ Get the latest source code
#{project_name} stores its source code in a [Git](http://git-scm.com/) repository hosted on [github](http://github.com) at this location:
* [#{github_page}](#{github_page})
-
* [#{github_page_native}](#{github_page_native})
If you are new to Git you might like to try the [Git guide for subversion users](http://git.or.cz/course/svn.html) or have a look at the [Git community book](http://book.git-scm.com/).
=====================================
jansi-website/src/download.page
=====================================
@@ -43,7 +43,7 @@ table.download tr td {
- for( version <- project_versions.headOption )
:&markdown
- ### #{project_name} #{version}
+ ### #{project_name} #{version} ([changelog](https://github.com/fusesource/jansi/blob/master/changelog.md))
table.download
tr
=====================================
jansi/pom.xml
=====================================
@@ -20,7 +20,7 @@
<parent>
<groupId>org.fusesource.jansi</groupId>
<artifactId>jansi-project</artifactId>
- <version>1.16</version>
+ <version>1.17.1</version>
</parent>
<artifactId>jansi</artifactId>
@@ -32,7 +32,7 @@
<dependency>
<groupId>org.fusesource.hawtjni</groupId>
<artifactId>hawtjni-runtime</artifactId>
- <version>1.15</version>
+ <version>1.16</version>
</dependency>
<dependency>
@@ -144,6 +144,7 @@
</goals>
<configuration>
<instructions>
+ <Main-Class>org.fusesource.jansi.AnsiMain</Main-Class>
<Export-Package>
org.fusesource.jansi,
org.fusesource.jansi.internal
=====================================
jansi/src/main/java/org/fusesource/jansi/Ansi.java
=====================================
@@ -236,7 +236,7 @@ public class Ansi {
}
@Override
- public Ansi cursor(int x, int y) {
+ public Ansi cursor(int row, int column) {
return this;
}
@@ -494,8 +494,17 @@ public class Ansi {
return this;
}
- public Ansi cursor(final int x, final int y) {
- return appendEscapeSequence('H', x, y);
+ /**
+ * Moves the cursor to row n, column m.
+ * The values are 1-based, and default to 1 (top left corner) if omitted.
+ * A sequence such as CSI ;5H is a synonym for CSI 1;5H as well as CSI 17;H is the same as CSI 17H and CSI 17;1H
+ *
+ * @param row row (1-based) from top
+ * @param column column (1 based) from left
+ * @return Ansi
+ */
+ public Ansi cursor(final int row, final int column) {
+ return appendEscapeSequence('H', row, column);
}
public Ansi cursorToColumn(final int x) {
=====================================
jansi/src/main/java/org/fusesource/jansi/AnsiConsole.java
=====================================
@@ -15,8 +15,6 @@
*/
package org.fusesource.jansi;
-import org.fusesource.jansi.internal.Kernel32;
-
import static org.fusesource.jansi.internal.CLibrary.STDERR_FILENO;
import static org.fusesource.jansi.internal.CLibrary.STDOUT_FILENO;
import static org.fusesource.jansi.internal.CLibrary.isatty;
@@ -25,15 +23,17 @@ import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
-import java.io.UnsupportedEncodingException;
-import java.nio.charset.Charset;
import java.util.Locale;
/**
- * Provides consistent access to an ANSI aware console PrintStream.
+ * Provides consistent access to an ANSI aware console PrintStream or an ANSI codes stripping PrintStream
+ * if not on a terminal (see
+ * <a href="http://fusesource.github.io/jansi/documentation/native-api/index.html?org/fusesource/jansi/internal/CLibrary.html">Jansi native isatty(int)</a>).
*
* @author <a href="http://hiramchirino.com">Hiram Chirino</a>
* @since 1.0
+ * @see #systemInstall()
+ * @see #wrapPrintStream(PrintStream, int) wrapPrintStream(PrintStream, int) for more details on ANSI mode selection
*/
public class AnsiConsole {
@@ -43,34 +43,26 @@ public class AnsiConsole {
public static final PrintStream system_err = System.err;
public static final PrintStream err;
- private static final boolean IS_WINDOWS = System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("win");
+ static final boolean IS_WINDOWS = System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("win");
- private static final boolean IS_CYGWIN = IS_WINDOWS
+ static final boolean IS_CYGWIN = IS_WINDOWS
&& System.getenv("PWD") != null
&& System.getenv("PWD").startsWith("/")
&& !"cygwin".equals(System.getenv("TERM"));
- private static final boolean IS_MINGW = IS_WINDOWS
+ static final boolean IS_MINGW_XTERM = IS_WINDOWS
&& System.getenv("MSYSTEM") != null
- && System.getenv("MSYSTEM").startsWith("MINGW");
+ && System.getenv("MSYSTEM").startsWith("MINGW")
+ && "xterm".equals(System.getenv("TERM"));
+ private static JansiOutputType jansiOutputType;
+ static final JansiOutputType JANSI_STDOUT_TYPE;
+ static final JansiOutputType JANSI_STDERR_TYPE;
static {
- String charset = Charset.defaultCharset().name();
- if (IS_WINDOWS && !IS_CYGWIN && !IS_MINGW) {
- int codepage = Kernel32.GetConsoleOutputCP();
- //http://docs.oracle.com/javase/6/docs/technotes/guides/intl/encoding.doc.html
- if (Charset.isSupported("ms" + codepage)) {
- charset = "ms" + codepage;
- } else if (Charset.isSupported("cp" + codepage)) {
- charset = "cp" + codepage;
- }
- }
- try {
- out = new PrintStream(wrapOutputStream(system_out), false, charset);
- err = new PrintStream(wrapErrorOutputStream(system_err), false, charset);
- } catch (UnsupportedEncodingException e) {
- throw new RuntimeException(e);
- }
+ out = wrapSystemOut(system_out);
+ JANSI_STDOUT_TYPE = jansiOutputType;
+ err = wrapSystemErr(system_err);
+ JANSI_STDERR_TYPE = jansiOutputType;
}
private static int installed;
@@ -78,6 +70,7 @@ public class AnsiConsole {
private AnsiConsole() {
}
+ @Deprecated
public static OutputStream wrapOutputStream(final OutputStream stream) {
try {
return wrapOutputStream(stream, STDOUT_FILENO);
@@ -86,6 +79,15 @@ public class AnsiConsole {
}
}
+ public static PrintStream wrapSystemOut(final PrintStream ps) {
+ try {
+ return wrapPrintStream(ps, STDOUT_FILENO);
+ } catch (Throwable ignore) {
+ return wrapPrintStream(ps, 1);
+ }
+ }
+
+ @Deprecated
public static OutputStream wrapErrorOutputStream(final OutputStream stream) {
try {
return wrapOutputStream(stream, STDERR_FILENO);
@@ -94,24 +96,36 @@ public class AnsiConsole {
}
}
+ public static PrintStream wrapSystemErr(final PrintStream ps) {
+ try {
+ return wrapPrintStream(ps, STDERR_FILENO);
+ } catch (Throwable ignore) {
+ return wrapPrintStream(ps, 2);
+ }
+ }
+
+ @Deprecated
public static OutputStream wrapOutputStream(final OutputStream stream, int fileno) {
// If the jansi.passthrough property is set, then don't interpret
// any of the ansi sequences.
if (Boolean.getBoolean("jansi.passthrough")) {
+ jansiOutputType = JansiOutputType.PASSTHROUGH;
return stream;
}
// If the jansi.strip property is set, then we just strip the
// the ansi escapes.
if (Boolean.getBoolean("jansi.strip")) {
+ jansiOutputType = JansiOutputType.STRIP_ANSI;
return new AnsiOutputStream(stream);
}
- if (IS_WINDOWS && !IS_CYGWIN && !IS_MINGW) {
+ if (IS_WINDOWS && !IS_CYGWIN && !IS_MINGW_XTERM) {
// On windows we know the console does not interpret ANSI codes..
try {
+ jansiOutputType = JansiOutputType.WINDOWS;
return new WindowsAnsiOutputStream(stream);
} catch (Throwable ignore) {
// this happens when JNA is not in the path.. or
@@ -119,6 +133,7 @@ public class AnsiConsole {
}
// Use the ANSIOutputStream to strip out the ANSI escape sequences.
+ jansiOutputType = JansiOutputType.STRIP_ANSI;
return new AnsiOutputStream(stream);
}
@@ -130,6 +145,7 @@ public class AnsiConsole {
// If we can detect that stdout is not a tty.. then setup
// to strip the ANSI sequences..
if (!forceColored && isatty(fileno) == 0) {
+ jansiOutputType = JansiOutputType.STRIP_ANSI;
return new AnsiOutputStream(stream);
}
} catch (Throwable ignore) {
@@ -140,6 +156,7 @@ public class AnsiConsole {
// By default we assume your Unix tty can handle ANSI codes.
// Just wrap it up so that when we get closed, we reset the
// attributes.
+ jansiOutputType = JansiOutputType.RESET_ANSI_AT_CLOSE;
return new FilterOutputStream(stream) {
@Override
public void close() throws IOException {
@@ -150,6 +167,84 @@ public class AnsiConsole {
};
}
+ /**
+ * Wrap PrintStream applying rules in following order:<ul>
+ * <li>if <code>jansi.passthrough</code> is <code>true</code>, don't wrap but just passthrough (console is
+ * expected to natively support ANSI escape codes),</li>
+ * <li>if <code>jansi.strip</code> is <code>true</code>, just strip ANSI escape codes inconditionally,</li>
+ * <li>if OS is Windows and terminal is not Cygwin or Mingw, wrap as WindowsAnsiPrintStream to process ANSI escape codes,</li>
+ * <li>if file descriptor is a terminal (see <code>isatty(int)</code>) or <code>jansi.force</code> is <code>true</code>,
+ * just passthrough,</li>
+ * <li>else strip ANSI escape codes (not a terminal).</li>
+ * </ul>
+ *
+ * @param ps original PrintStream to wrap
+ * @param fileno file descriptor
+ * @return wrapped PrintStream depending on OS and system properties
+ * @since 1.17
+ */
+ public static PrintStream wrapPrintStream(final PrintStream ps, int fileno) {
+
+ // If the jansi.passthrough property is set, then don't interpret
+ // any of the ansi sequences.
+ if (Boolean.getBoolean("jansi.passthrough")) {
+ jansiOutputType = JansiOutputType.PASSTHROUGH;
+ return ps;
+ }
+
+ // If the jansi.strip property is set, then we just strip the
+ // the ansi escapes.
+ if (Boolean.getBoolean("jansi.strip")) {
+ jansiOutputType = JansiOutputType.STRIP_ANSI;
+ return new AnsiPrintStream(ps);
+ }
+
+ if (IS_WINDOWS && !IS_CYGWIN && !IS_MINGW_XTERM) {
+
+ // On windows we know the console does not interpret ANSI codes..
+ try {
+ jansiOutputType = JansiOutputType.WINDOWS;
+ return new WindowsAnsiPrintStream(ps);
+ } 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 AnsiPrintStream to strip out the ANSI escape sequences.
+ jansiOutputType = JansiOutputType.STRIP_ANSI;
+ return new AnsiPrintStream(ps);
+ }
+
+ // We must be on some Unix variant, including Cygwin or MSYS(2) on Windows...
+ try {
+ // If the jansi.force property is set, then we force to output
+ // the ansi escapes for piping it into ansi color aware commands (e.g. less -r)
+ boolean forceColored = Boolean.getBoolean("jansi.force");
+ // If we can detect that stdout is not a tty.. then setup
+ // to strip the ANSI sequences..
+ if (!forceColored && isatty(fileno) == 0) {
+ jansiOutputType = JansiOutputType.STRIP_ANSI;
+ return new AnsiPrintStream(ps);
+ }
+ } catch (Throwable ignore) {
+ // These errors happen if the JNI lib is not available for your platform.
+ // But since we are on ANSI friendly platform, assume the user is on the console.
+ }
+
+ // By default we assume your Unix tty can handle ANSI codes.
+ // Just wrap it up so that when we get closed, we reset the
+ // attributes.
+ jansiOutputType = JansiOutputType.RESET_ANSI_AT_CLOSE;
+ return new FilterPrintStream(ps) {
+ @Override
+ public void close() {
+ ps.print(AnsiPrintStream.RESET_CODE);
+ ps.flush();
+ super.close();
+ }
+ };
+ }
+
/**
* If the standard out natively supports ANSI escape codes, then this just
* returns System.out, otherwise it will provide an ANSI aware PrintStream
@@ -157,6 +252,7 @@ public class AnsiConsole {
* sequences.
*
* @return a PrintStream which is ANSI aware.
+ * @see #wrapPrintStream(PrintStream, int)
*/
public static PrintStream out() {
return out;
@@ -169,13 +265,16 @@ public class AnsiConsole {
* sequences.
*
* @return a PrintStream which is ANSI aware.
+ * @see #wrapPrintStream(PrintStream, int)
*/
public static PrintStream err() {
return err;
}
/**
- * Install Console.out to System.out.
+ * Install <code>AnsiConsole.out</code> to <code>System.out</code> and
+ * <code>AnsiConsole.err</code> to <code>System.err</code>.
+ * @see #systemUninstall()
*/
synchronized static public void systemInstall() {
installed++;
@@ -187,7 +286,7 @@ public class AnsiConsole {
/**
* undo a previous {@link #systemInstall()}. If {@link #systemInstall()} was called
- * multiple times, it {@link #systemUninstall()} must call the same number of times before
+ * multiple times, {@link #systemUninstall()} must be called the same number of times before
* it is actually uninstalled.
*/
synchronized public static void systemUninstall() {
@@ -198,4 +297,24 @@ public class AnsiConsole {
}
}
+ /**
+ * Type of output installed by AnsiConsole.
+ */
+ enum JansiOutputType {
+ PASSTHROUGH("just pass through, ANSI escape codes are supposed to be supported by terminal"),
+ RESET_ANSI_AT_CLOSE("like pass through but reset ANSI attributes when closing the stream"),
+ STRIP_ANSI("strip ANSI escape codes, for example when output is not a terminal"),
+ WINDOWS("detect ANSI escape codes and transform Jansi-supported ones into a Windows API to get desired effect" +
+ " (since ANSI escape codes are not natively supported by Windows terminals like cmd.exe or PowerShell)");
+
+ private final String description;
+
+ private JansiOutputType(String description) {
+ this.description = description;
+ }
+
+ String getDescription() {
+ return description;
+ }
+ };
}
=====================================
jansi/src/main/java/org/fusesource/jansi/AnsiMain.java
=====================================
@@ -0,0 +1,234 @@
+/*
+ * Copyright (C) 2009-2017 the original author(s).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.fusesource.jansi;
+
+import static org.fusesource.jansi.Ansi.ansi;
+
+import java.io.Closeable;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.PrintStream;
+import java.io.Reader;
+import java.util.Properties;
+
+import org.fusesource.hawtjni.runtime.Library;
+import org.fusesource.jansi.internal.CLibrary;
+import static org.fusesource.jansi.internal.CLibrary.isatty;
+
+/**
+ * Main class for the library, providing executable jar to diagnose Jansi setup.
+ * <p>If no system property is set and output is sent to a terminal (no redirect to a file):
+ * <ul>
+ * <li>any terminal on any Unix should get <code>RESET_ANSI_AT_CLOSE</code> mode,</li>
+ * <li>on Windows, Git-bash or Cygwin terminals should get <code>RESET_ANSI_AT_CLOSE</code> mode also, since they
+ * support natively ANSI escape sequences like any Unix terminal,</li>
+ * <li>on Windows, cmd.exe, PowerShell or Git-cmd terminals should get <code>WINDOWS</code> mode.</li>
+ * </ul>
+ * The results will vary if you play with <code>jansi.passthrough</code>, <code>jansi.strip</code> or
+ * <code>jansi.force</code> system property, or if you redirect output to a file.
+ * <p>If you have a specific situation that is not covered, please report precise conditions to reproduce
+ * the issue and ideas on how to detect precisely the affected situation.
+ */
+public class AnsiMain {
+ public static void main(String... args) throws IOException {
+ System.out.println("Jansi " + getJansiVersion()
+ + " (Jansi native " + getPomPropertiesVersion("org.fusesource.jansi/jansi-native")
+ + ", HawtJNI runtime " + getPomPropertiesVersion("org.fusesource.hawtjni/hawtjni-runtime") + ")");
+
+ System.out.println();
+
+ // info on native library
+ System.out.println("library.jansi.path= " + System.getProperty("library.jansi.path", ""));
+ System.out.println("library.jansi.version= " + System.getProperty("library.jansi.version", ""));
+ Library lib = new Library("jansi", CLibrary.class);
+ lib.load();
+ System.out.println("Jansi native library loaded from " + lib.getNativeLibraryPath());
+ if (lib.getNativeLibrarySourceUrl() != null) {
+ System.out.println(" which was auto-extracted from " + lib.getNativeLibrarySourceUrl());
+ }
+
+ System.out.println();
+
+ System.out.println("os.name= " + System.getProperty("os.name") + ", "
+ + "os.version= " + System.getProperty("os.version") + ", "
+ + "os.arch= " + System.getProperty("os.arch"));
+ System.out.println("file.encoding= " + System.getProperty("file.encoding"));
+ System.out.println("java.version= " + System.getProperty("java.version") + ", "
+ + "java.vendor= " + System.getProperty("java.vendor") + ","
+ + " java.home= " + System.getProperty("java.home"));
+
+ System.out.println();
+
+ System.out.println("jansi.passthrough= " + Boolean.getBoolean("jansi.passthrough"));
+ System.out.println("jansi.strip= " + Boolean.getBoolean("jansi.strip"));
+ System.out.println("jansi.force= " + Boolean.getBoolean("jansi.force"));
+ System.out.println(Ansi.DISABLE + "= " + Boolean.getBoolean(Ansi.DISABLE));
+
+ System.out.println();
+
+ System.out.println("IS_WINDOWS: " + AnsiConsole.IS_WINDOWS);
+ if (AnsiConsole.IS_WINDOWS) {
+ System.out.println("IS_CYGWIN: " + AnsiConsole.IS_CYGWIN);
+ System.out.println("IS_MINGW_XTERM: " + AnsiConsole.IS_MINGW_XTERM);
+ }
+
+ System.out.println();
+
+ diagnoseTty(false); // System.out
+ diagnoseTty(true); // System.err
+
+ AnsiConsole.systemInstall();
+
+ System.out.println();
+
+ System.out.println("Resulting Jansi modes for stout/stderr streams:");
+ System.out.println(" - System.out: " + AnsiConsole.JANSI_STDOUT_TYPE);
+ System.out.println(" - System.err: " + AnsiConsole.JANSI_STDERR_TYPE);
+ System.out.println("modes description:");
+ int n = 1;
+ for(AnsiConsole.JansiOutputType type: AnsiConsole.JansiOutputType.values()) {
+ System.out.println(n++ + ". " + type + ": " + type.getDescription());
+ }
+
+ try {
+ System.out.println();
+
+ testAnsi(false);
+ testAnsi(true);
+
+ if (args.length == 0) {
+ printJansiLogoDemo();
+ return;
+ }
+
+ System.out.println();
+
+ if (args.length == 1) {
+ File f = new File(args[0]);
+ if (f.exists())
+ {
+ // write file content
+ System.out.println(ansi().bold().a("\"" + args[0] + "\" content:").reset());
+ writeFileContent(f);
+ return;
+ }
+ }
+
+ // write args without Jansi then with Jansi AnsiConsole
+ System.out.println(ansi().bold().a("original args:").reset());
+ int i = 1;
+ for (String arg: args) {
+ AnsiConsole.system_out.print(i++ + ": ");
+ AnsiConsole.system_out.println(arg);
+ }
+
+ System.out.println(ansi().bold().a("Jansi filtered args:").reset());
+ i = 1;
+ for (String arg: args) {
+ System.out.print(i++ + ": ");
+ System.out.println(arg);
+ }
+ } finally {
+ AnsiConsole.systemUninstall();
+ }
+ }
+
+ private static String getJansiVersion() {
+ Package p = AnsiMain.class.getPackage();
+ return ( p == null ) ? null : p.getImplementationVersion();
+ }
+
+ private static void diagnoseTty(boolean stderr) {
+ int fd = stderr ? CLibrary.STDERR_FILENO : CLibrary.STDOUT_FILENO;
+ int isatty = isatty(fd);
+
+ System.out.println("isatty(STD" + (stderr ? "ERR" : "OUT") + "_FILENO): " + isatty + ", System."
+ + (stderr ? "err" : "out") + " " + ((isatty == 0) ? "is *NOT*" : "is") + " a terminal");
+ }
+
+ private static void testAnsi(boolean stderr) {
+ @SuppressWarnings( "resource" )
+ PrintStream s = stderr ? System.err : System.out;
+ s.print("test on System." + (stderr ? "err" : "out") + ":");
+ for(Ansi.Color c: Ansi.Color.values()) {
+ s.print(" " + ansi().fg(c) + c + ansi().reset());
+ }
+ s.println();
+ s.print(" bright:");
+ for(Ansi.Color c: Ansi.Color.values()) {
+ s.print(" " + ansi().fgBright(c) + c + ansi().reset());
+ }
+ s.println();
+ s.print(" bold:");
+ for(Ansi.Color c: Ansi.Color.values()) {
+ s.print(" " + ansi().bold().fg(c) + c + ansi().reset());
+ }
+ s.println();
+ }
+
+ private static String getPomPropertiesVersion(String path) throws IOException {
+ InputStream in = AnsiMain.class.getResourceAsStream("/META-INF/maven/" + path + "/pom.properties");
+ if (in == null) {
+ return null;
+ }
+ try {
+ Properties p = new Properties();
+ p.load(in);
+ return p.getProperty("version");
+ } finally {
+ closeQuietly(in);
+ }
+ }
+
+ private static void printJansiLogoDemo() throws IOException {
+ Reader in = new InputStreamReader(AnsiMain.class.getResourceAsStream("jansi.txt"), "UTF-8");
+ try {
+ char[] buf = new char[1024];
+ int l = 0;
+ while ((l = in.read(buf)) >= 0) {
+ for(int i = 0; i < l; i++) {
+ System.out.print(buf[i]);
+ }
+ }
+ } finally {
+ closeQuietly(in);
+ }
+ }
+
+ private static void writeFileContent(File f) throws IOException {
+ InputStream in = new FileInputStream(f);
+ try {
+ byte[] buf = new byte[1024];
+ int l = 0;
+ while ((l = in.read(buf)) >= 0) {
+ System.out.write(buf, 0, l);
+ }
+ } finally {
+ closeQuietly(in);
+ }
+ }
+
+ private static void closeQuietly(Closeable c) {
+ try {
+ c.close();
+ } catch (IOException ioe) {
+ ioe.printStackTrace(System.err);
+ }
+ }
+}
=====================================
jansi/src/main/java/org/fusesource/jansi/AnsiOutputStream.java
=====================================
@@ -15,9 +15,9 @@
*/
package org.fusesource.jansi;
-import java.io.FilterOutputStream;
+import java.io.FilterOutputStream; // expected diff with AnsiPrintStream.java
import java.io.IOException;
-import java.io.OutputStream;
+import java.io.OutputStream; // expected diff with AnsiPrintStream.java
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Iterator;
@@ -26,10 +26,10 @@ import java.util.Iterator;
* A ANSI output stream extracts ANSI escape codes written to
* an output stream and calls corresponding <code>process*</code> methods.
*
- * For more information about ANSI escape codes, see:
- * http://en.wikipedia.org/wiki/ANSI_escape_code
+ * <p>For more information about ANSI escape codes, see
+ * <a href="http://en.wikipedia.org/wiki/ANSI_escape_code">Wikipedia article</a>
*
- * This class just filters out the escape codes so that they are not
+ * <p>This class just filters out the escape codes so that they are not
* sent out to the underlying OutputStream: <code>process*</code> methods
* are empty. Subclasses should actually perform the ANSI escape behaviors
* by implementing active code in <code>process*</code> methods.
@@ -37,16 +37,17 @@ import java.util.Iterator;
* @author <a href="http://hiramchirino.com">Hiram Chirino</a>
* @author Joris Kuipers
* @since 1.0
+ * @see AnsiPrintStream
*/
-public class AnsiOutputStream extends FilterOutputStream {
+public class AnsiOutputStream extends FilterOutputStream { // expected diff with AnsiPrintStream.java
- public static final byte[] RESET_CODE = "\033[0m".getBytes();
+ public static final byte[] RESET_CODE = "\033[0m".getBytes(); // expected diff with AnsiPrintStream.java
@Deprecated
- public static final byte[] REST_CODE = RESET_CODE;
+ public static final byte[] REST_CODE = RESET_CODE; // expected diff with AnsiPrintStream.java
- public AnsiOutputStream(OutputStream os) {
- super(os);
+ public AnsiOutputStream(OutputStream os) { // expected diff with AnsiPrintStream.java
+ super(os); // expected diff with AnsiPrintStream.java
}
private final static int MAX_ESCAPE_SEQUENCE_LENGTH = 100;
@@ -64,6 +65,7 @@ public class AnsiOutputStream extends FilterOutputStream {
private static final int LOOKING_FOR_OSC_COMMAND_END = 6;
private static final int LOOKING_FOR_OSC_PARAM = 7;
private static final int LOOKING_FOR_ST = 8;
+ private static final int LOOKING_FOR_CHARSET = 9;
int state = LOOKING_FOR_FIRST_ESC_CHAR;
@@ -72,18 +74,23 @@ public class AnsiOutputStream extends FilterOutputStream {
private static final int SECOND_OSC_CHAR = ']';
private static final int BEL = 7;
private static final int SECOND_ST_CHAR = '\\';
+ private static final int SECOND_CHARSET0_CHAR = '(';
+ private static final int SECOND_CHARSET1_CHAR = ')';
+ /**
+ * {@inheritDoc}
+ */
@Override
- public synchronized void write(int data) throws IOException {
+ public synchronized void write(int data) throws IOException { // expected diff with AnsiPrintStream.java
switch (state) {
case LOOKING_FOR_FIRST_ESC_CHAR:
if (data == FIRST_ESC_CHAR) {
buffer[pos++] = (byte) data;
state = LOOKING_FOR_SECOND_ESC_CHAR;
- } else {
- out.write(data);
+ } else { // expected diff with AnsiPrintStream.java
+ out.write(data); // expected diff with AnsiPrintStream.java
}
- break;
+ break; // expected diff with AnsiPrintStream.java
case LOOKING_FOR_SECOND_ESC_CHAR:
buffer[pos++] = (byte) data;
@@ -91,6 +98,12 @@ public class AnsiOutputStream extends FilterOutputStream {
state = LOOKING_FOR_NEXT_ARG;
} else if (data == SECOND_OSC_CHAR) {
state = LOOKING_FOR_OSC_COMMAND;
+ } else if (data == SECOND_CHARSET0_CHAR) {
+ options.add(Integer.valueOf(0));
+ state = LOOKING_FOR_CHARSET;
+ } else if (data == SECOND_CHARSET1_CHAR) {
+ options.add(Integer.valueOf(1));
+ state = LOOKING_FOR_CHARSET;
} else {
reset(false);
}
@@ -193,6 +206,11 @@ public class AnsiOutputStream extends FilterOutputStream {
state = LOOKING_FOR_OSC_PARAM;
}
break;
+
+ case LOOKING_FOR_CHARSET:
+ options.add(Character.valueOf((char) data));
+ reset(processCharsetSelect(options));
+ break;
}
// Is it just too long?
@@ -206,9 +224,9 @@ public class AnsiOutputStream extends FilterOutputStream {
* @param skipBuffer if current buffer should be skipped or written to out
* @throws IOException
*/
- private void reset(boolean skipBuffer) throws IOException {
+ private void reset(boolean skipBuffer) throws IOException { // expected diff with AnsiPrintStream.java
if (!skipBuffer) {
- out.write(buffer, 0, pos);
+ out.write(buffer, 0, pos); // expected diff with AnsiPrintStream.java
}
pos = 0;
startOfValue = 0;
@@ -237,7 +255,7 @@ public class AnsiOutputStream extends FilterOutputStream {
* @param command
* @return true if the escape command was processed.
*/
- private boolean processEscapeCommand(ArrayList<Object> options, int command) throws IOException {
+ private boolean processEscapeCommand(ArrayList<Object> options, int command) throws IOException { // expected diff with AnsiPrintStream.java
try {
switch (command) {
case 'A':
@@ -387,7 +405,7 @@ public class AnsiOutputStream extends FilterOutputStream {
* @param options
* @return true if the operating system command was processed.
*/
- private boolean processOperatingSystemCommand(ArrayList<Object> options) throws IOException {
+ private boolean processOperatingSystemCommand(ArrayList<Object> options) throws IOException { // expected diff with AnsiPrintStream.java
int command = optionInt(options, 0);
String label = (String) options.get(1);
// for command > 2 label could be composed (i.e. contain ';'), but we'll leave
@@ -416,42 +434,48 @@ public class AnsiOutputStream extends FilterOutputStream {
/**
* Process <code>CSI u</code> ANSI code, corresponding to <code>RCP – Restore Cursor Position</code>
- * @throws IOException
+ * @throws IOException IOException
*/
protected void processRestoreCursorPosition() throws IOException {
}
/**
* Process <code>CSI s</code> ANSI code, corresponding to <code>SCP – Save Cursor Position</code>
- * @throws IOException
+ * @throws IOException IOException
*/
protected void processSaveCursorPosition() throws IOException {
}
/**
- * Process <code>CSI s</code> ANSI code, corresponding to <code>IL – Insert Line</code>
- * @throws IOException
+ * Process <code>CSI L</code> ANSI code, corresponding to <code>IL – Insert Line</code>
+ * @param optionInt option
+ * @throws IOException IOException
+ * @since 1.16
*/
protected void processInsertLine(int optionInt) throws IOException {
}
/**
- * Process <code>CSI s</code> ANSI code, corresponding to <code>DL – Delete Line</code>
- * @throws IOException
+ * Process <code>CSI M</code> ANSI code, corresponding to <code>DL – Delete Line</code>
+ * @param optionInt option
+ * @throws IOException IOException
+ * @since 1.16
*/
protected void processDeleteLine(int optionInt) throws IOException {
}
/**
* Process <code>CSI n T</code> ANSI code, corresponding to <code>SD – Scroll Down</code>
- * @throws IOException
+ * @param optionInt option
+ * @throws IOException IOException
*/
protected void processScrollDown(int optionInt) throws IOException {
}
/**
* Process <code>CSI n U</code> ANSI code, corresponding to <code>SU – Scroll Up</code>
- * @throws IOException
+ * @param optionInt option
+ * @throws IOException IOException
*/
protected void processScrollUp(int optionInt) throws IOException {
}
@@ -462,7 +486,8 @@ public class AnsiOutputStream extends FilterOutputStream {
/**
* Process <code>CSI n J</code> ANSI code, corresponding to <code>ED – Erase in Display</code>
- * @throws IOException
+ * @param eraseOption eraseOption
+ * @throws IOException IOException
*/
protected void processEraseScreen(int eraseOption) throws IOException {
}
@@ -473,7 +498,8 @@ public class AnsiOutputStream extends FilterOutputStream {
/**
* Process <code>CSI n K</code> ANSI code, corresponding to <code>ED – Erase in Line</code>
- * @throws IOException
+ * @param eraseOption eraseOption
+ * @throws IOException IOException
*/
protected void processEraseLine(int eraseOption) throws IOException {
}
@@ -499,8 +525,8 @@ public class AnsiOutputStream extends FilterOutputStream {
* process <code>SGR</code> other than <code>0</code> (reset), <code>30-39</code> (foreground),
* <code>40-49</code> (background), <code>90-97</code> (foreground high intensity) or
* <code>100-107</code> (background high intensity)
- * @param attribute
- * @throws IOException
+ * @param attribute attribute
+ * @throws IOException IOException
* @see #processAttributeRest()
* @see #processSetForegroundColor(int)
* @see #processSetForegroundColor(int, boolean)
@@ -524,7 +550,7 @@ public class AnsiOutputStream extends FilterOutputStream {
/**
* process <code>SGR 30-37</code> corresponding to <code>Set text color (foreground)</code>.
* @param color the text color
- * @throws IOException
+ * @throws IOException IOException
*/
protected void processSetForegroundColor(int color) throws IOException {
processSetForegroundColor(color, false);
@@ -535,7 +561,7 @@ public class AnsiOutputStream extends FilterOutputStream {
* <code>Set text color (foreground)</code> either in normal mode or high intensity.
* @param color the text color
* @param bright is high intensity?
- * @throws IOException
+ * @throws IOException IOException
*/
protected void processSetForegroundColor(int color, boolean bright) throws IOException {
}
@@ -544,7 +570,7 @@ public class AnsiOutputStream extends FilterOutputStream {
* process <code>SGR 38</code> corresponding to <code>extended set text color (foreground)</code>
* with a palette of 255 colors.
* @param paletteIndex the text color in the palette
- * @throws IOException
+ * @throws IOException IOException
*/
protected void processSetForegroundColorExt(int paletteIndex) throws IOException {
}
@@ -555,7 +581,7 @@ public class AnsiOutputStream extends FilterOutputStream {
* @param r red
* @param g green
* @param b blue
- * @throws IOException
+ * @throws IOException IOException
*/
protected void processSetForegroundColorExt(int r, int g, int b) throws IOException {
}
@@ -563,7 +589,7 @@ public class AnsiOutputStream extends FilterOutputStream {
/**
* process <code>SGR 40-47</code> corresponding to <code>Set background color</code>.
* @param color the background color
- * @throws IOException
+ * @throws IOException IOException
*/
protected void processSetBackgroundColor(int color) throws IOException {
processSetBackgroundColor(color, false);
@@ -574,7 +600,7 @@ public class AnsiOutputStream extends FilterOutputStream {
* <code>Set background color</code> either in normal mode or high intensity.
* @param color the background color
* @param bright is high intensity?
- * @throws IOException
+ * @throws IOException IOException
*/
protected void processSetBackgroundColor(int color, boolean bright) throws IOException {
}
@@ -583,7 +609,7 @@ public class AnsiOutputStream extends FilterOutputStream {
* process <code>SGR 48</code> corresponding to <code>extended set background color</code>
* with a palette of 255 colors.
* @param paletteIndex the background color in the palette
- * @throws IOException
+ * @throws IOException IOException
*/
protected void processSetBackgroundColorExt(int paletteIndex) throws IOException {
}
@@ -594,28 +620,28 @@ public class AnsiOutputStream extends FilterOutputStream {
* @param r red
* @param g green
* @param b blue
- * @throws IOException
+ * @throws IOException IOException
*/
protected void processSetBackgroundColorExt(int r, int g, int b) throws IOException {
}
/**
* process <code>SGR 39</code> corresponding to <code>Default text color (foreground)</code>
- * @throws IOException
+ * @throws IOException IOException
*/
protected void processDefaultTextColor() throws IOException {
}
/**
* process <code>SGR 49</code> corresponding to <code>Default background color</code>
- * @throws IOException
+ * @throws IOException IOException
*/
protected void processDefaultBackgroundColor() throws IOException {
}
/**
* process <code>SGR 0</code> corresponding to <code>Reset / Normal</code>
- * @throws IOException
+ * @throws IOException IOException
*/
protected void processAttributeRest() throws IOException {
}
@@ -623,9 +649,9 @@ public class AnsiOutputStream extends FilterOutputStream {
/**
* process <code>CSI n ; m H</code> corresponding to <code>CUP – Cursor Position</code> or
* <code>CSI n ; m f</code> corresponding to <code>HVP – Horizontal and Vertical Position</code>
- * @param row
- * @param col
- * @throws IOException
+ * @param row row
+ * @param col column
+ * @throws IOException IOException
*/
protected void processCursorTo(int row, int col) throws IOException {
}
@@ -633,7 +659,7 @@ public class AnsiOutputStream extends FilterOutputStream {
/**
* process <code>CSI n G</code> corresponding to <code>CHA – Cursor Horizontal Absolute</code>
* @param x the column
- * @throws IOException
+ * @throws IOException IOException
*/
protected void processCursorToColumn(int x) throws IOException {
}
@@ -641,7 +667,7 @@ public class AnsiOutputStream extends FilterOutputStream {
/**
* process <code>CSI n F</code> corresponding to <code>CPL – Cursor Previous Line</code>
* @param count line count
- * @throws IOException
+ * @throws IOException IOException
*/
protected void processCursorUpLine(int count) throws IOException {
}
@@ -649,47 +675,47 @@ public class AnsiOutputStream extends FilterOutputStream {
/**
* process <code>CSI n E</code> corresponding to <code>CNL – Cursor Next Line</code>
* @param count line count
- * @throws IOException
+ * @throws IOException IOException
*/
protected void processCursorDownLine(int count) throws IOException {
// Poor mans impl..
for (int i = 0; i < count; i++) {
- out.write('\n');
+ out.write('\n'); // expected diff with AnsiPrintStream.java
}
}
/**
* process <code>CSI n D</code> corresponding to <code>CUB – Cursor Back</code>
- * @param count
- * @throws IOException
+ * @param count numer of characters to move left
+ * @throws IOException IOException
*/
protected void processCursorLeft(int count) throws IOException {
}
/**
* process <code>CSI n C</code> corresponding to <code>CUF – Cursor Forward</code>
- * @param count
- * @throws IOException
+ * @param count number of characters to move on
+ * @throws IOException IOException
*/
protected void processCursorRight(int count) throws IOException {
// Poor mans impl..
for (int i = 0; i < count; i++) {
- out.write(' ');
+ out.write(' '); // expected diff with AnsiPrintStream.java
}
}
/**
* process <code>CSI n B</code> corresponding to <code>CUD – Cursor Down</code>
- * @param count
- * @throws IOException
+ * @param count numer of line
+ * @throws IOException IOException
*/
protected void processCursorDown(int count) throws IOException {
}
/**
* process <code>CSI n A</code> corresponding to <code>CUU – Cursor Up</code>
- * @param count
- * @throws IOException
+ * @param count number of lines
+ * @throws IOException IOException
*/
protected void processCursorUp(int count) throws IOException {
}
@@ -699,8 +725,7 @@ public class AnsiOutputStream extends FilterOutputStream {
/**
* process <code>OSC 0;text BEL</code> corresponding to <code>Change Window and Icon label</code>
- * @param label
- * @throws IOException
+ * @param label window label
*/
protected void processChangeIconNameAndWindowTitle(String label) {
processChangeIconName(label);
@@ -709,28 +734,41 @@ public class AnsiOutputStream extends FilterOutputStream {
/**
* process <code>OSC 1;text BEL</code> corresponding to <code>Change Icon label</code>
- * @param label
- * @throws IOException
+ * @param label icon label name
*/
protected void processChangeIconName(String label) {
}
/**
* process <code>OSC 2;text BEL</code> corresponding to <code>Change Window title</code>
- * @param label
- * @throws IOException
+ * @param label window label
*/
protected void processChangeWindowTitle(String label) {
}
/**
* Process unknown <code>OSC</code> command.
- * @param command
- * @param param
+ * @param command command
+ * @param param command param
*/
protected void processUnknownOperatingSystemCommand(int command, String param) {
}
+ /**
+ * Process character set sequence.
+ * @param options set of options
+ * @return true if the charcter set select command was processed.
+ */
+ private boolean processCharsetSelect(ArrayList<Object> options) {
+ int set = optionInt(options, 0);
+ char seq = ((Character) options.get(1)).charValue();
+ processCharsetSelect(set, seq);
+ return true;
+ }
+
+ protected void processCharsetSelect(int set, char seq) {
+ }
+
private int optionInt(ArrayList<Object> options, int index) {
if (options.size() <= index)
throw new IllegalArgumentException();
@@ -754,8 +792,8 @@ public class AnsiOutputStream extends FilterOutputStream {
}
@Override
- public void close() throws IOException {
- write(RESET_CODE);
+ public void close() throws IOException { // expected diff with AnsiPrintStream.java
+ write(RESET_CODE); // expected diff with AnsiPrintStream.java
flush();
super.close();
}
=====================================
jansi/src/main/java/org/fusesource/jansi/AnsiPrintStream.java
=====================================
@@ -0,0 +1,800 @@
+/*
+ * Copyright (C) 2009-2017 the original author(s).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.fusesource.jansi;
+
+import java.io.IOException;
+import java.io.PrintStream; // expected diff with AnsiOutputStream.java
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+/**
+ * A ANSI print stream extracts ANSI escape codes written to
+ * a print stream and calls corresponding <code>process*</code> methods.
+ *
+ * <p>For more information about ANSI escape codes, see
+ * <a href="http://en.wikipedia.org/wiki/ANSI_escape_code">Wikipedia article</a>
+ *
+ * <p>This class just filters out the escape codes so that they are not
+ * sent out to the underlying OutputStream: <code>process*</code> methods
+ * are empty. Subclasses should actually perform the ANSI escape behaviors
+ * by implementing active code in <code>process*</code> methods.
+ *
+ * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
+ * @author Joris Kuipers
+ * @since 1.7
+ * @see AnsiOutputStream
+ */
+public class AnsiPrintStream extends FilterPrintStream { // expected diff with AnsiOutputStream.java
+
+ public static final String RESET_CODE = "\033[0m"; // expected diff with AnsiOutputStream.java
+
+ public AnsiPrintStream(PrintStream ps) { // expected diff with AnsiOutputStream.java
+ super(ps); // expected diff with AnsiOutputStream.java
+ }
+
+ private final static int MAX_ESCAPE_SEQUENCE_LENGTH = 100;
+ private final byte[] buffer = new byte[MAX_ESCAPE_SEQUENCE_LENGTH];
+ private int pos = 0;
+ private int startOfValue;
+ private final ArrayList<Object> options = new ArrayList<Object>();
+
+ private static final int LOOKING_FOR_FIRST_ESC_CHAR = 0;
+ private static final int LOOKING_FOR_SECOND_ESC_CHAR = 1;
+ private static final int LOOKING_FOR_NEXT_ARG = 2;
+ private static final int LOOKING_FOR_STR_ARG_END = 3;
+ private static final int LOOKING_FOR_INT_ARG_END = 4;
+ private static final int LOOKING_FOR_OSC_COMMAND = 5;
+ private static final int LOOKING_FOR_OSC_COMMAND_END = 6;
+ private static final int LOOKING_FOR_OSC_PARAM = 7;
+ private static final int LOOKING_FOR_ST = 8;
+ private static final int LOOKING_FOR_CHARSET = 9;
+
+ int state = LOOKING_FOR_FIRST_ESC_CHAR;
+
+ private static final int FIRST_ESC_CHAR = 27;
+ private static final int SECOND_ESC_CHAR = '[';
+ private static final int SECOND_OSC_CHAR = ']';
+ private static final int BEL = 7;
+ private static final int SECOND_ST_CHAR = '\\';
+ private static final int SECOND_CHARSET0_CHAR = '(';
+ private static final int SECOND_CHARSET1_CHAR = ')';
+
+ @Override
+ protected synchronized boolean filter(int data) { // expected diff with AnsiOutputStream.java
+ switch (state) {
+ case LOOKING_FOR_FIRST_ESC_CHAR:
+ if (data == FIRST_ESC_CHAR) {
+ buffer[pos++] = (byte) data;
+ state = LOOKING_FOR_SECOND_ESC_CHAR;
+ return false; // expected diff with AnsiOutputStream.java
+ }
+ return true; // expected diff with AnsiOutputStream.java
+
+ case LOOKING_FOR_SECOND_ESC_CHAR:
+ buffer[pos++] = (byte) data;
+ if (data == SECOND_ESC_CHAR) {
+ state = LOOKING_FOR_NEXT_ARG;
+ } else if (data == SECOND_OSC_CHAR) {
+ state = LOOKING_FOR_OSC_COMMAND;
+ } else if (data == SECOND_CHARSET0_CHAR) {
+ options.add(Integer.valueOf(0));
+ state = LOOKING_FOR_CHARSET;
+ } else if (data == SECOND_CHARSET1_CHAR) {
+ options.add(Integer.valueOf(1));
+ state = LOOKING_FOR_CHARSET;
+ } else {
+ reset(false);
+ }
+ break;
+
+ case LOOKING_FOR_NEXT_ARG:
+ buffer[pos++] = (byte) data;
+ if ('"' == data) {
+ startOfValue = pos - 1;
+ state = LOOKING_FOR_STR_ARG_END;
+ } else if ('0' <= data && data <= '9') {
+ startOfValue = pos - 1;
+ state = LOOKING_FOR_INT_ARG_END;
+ } else if (';' == data) {
+ options.add(null);
+ } else if ('?' == data) {
+ options.add('?');
+ } else if ('=' == data) {
+ options.add('=');
+ } else {
+ reset(processEscapeCommand(options, data));
+ }
+ break;
+ default:
+ break;
+
+ case LOOKING_FOR_INT_ARG_END:
+ buffer[pos++] = (byte) data;
+ if (!('0' <= data && data <= '9')) {
+ String strValue = new String(buffer, startOfValue, (pos - 1) - startOfValue, Charset.defaultCharset());
+ Integer value = new Integer(strValue);
+ options.add(value);
+ if (data == ';') {
+ state = LOOKING_FOR_NEXT_ARG;
+ } else {
+ reset(processEscapeCommand(options, data));
+ }
+ }
+ break;
+
+ case LOOKING_FOR_STR_ARG_END:
+ buffer[pos++] = (byte) data;
+ if ('"' != data) {
+ String value = new String(buffer, startOfValue, (pos - 1) - startOfValue, Charset.defaultCharset());
+ options.add(value);
+ if (data == ';') {
+ state = LOOKING_FOR_NEXT_ARG;
+ } else {
+ reset(processEscapeCommand(options, data));
+ }
+ }
+ break;
+
+ case LOOKING_FOR_OSC_COMMAND:
+ buffer[pos++] = (byte) data;
+ if ('0' <= data && data <= '9') {
+ startOfValue = pos - 1;
+ state = LOOKING_FOR_OSC_COMMAND_END;
+ } else {
+ reset(false);
+ }
+ break;
+
+ case LOOKING_FOR_OSC_COMMAND_END:
+ buffer[pos++] = (byte) data;
+ if (';' == data) {
+ String strValue = new String(buffer, startOfValue, (pos - 1) - startOfValue, Charset.defaultCharset());
+ Integer value = new Integer(strValue);
+ options.add(value);
+ startOfValue = pos;
+ state = LOOKING_FOR_OSC_PARAM;
+ } else if ('0' <= data && data <= '9') {
+ // already pushed digit to buffer, just keep looking
+ } else {
+ // oops, did not expect this
+ reset(false);
+ }
+ break;
+
+ case LOOKING_FOR_OSC_PARAM:
+ buffer[pos++] = (byte) data;
+ if (BEL == data) {
+ String value = new String(buffer, startOfValue, (pos - 1) - startOfValue, Charset.defaultCharset());
+ options.add(value);
+ reset(processOperatingSystemCommand(options));
+ } else if (FIRST_ESC_CHAR == data) {
+ state = LOOKING_FOR_ST;
+ } else {
+ // just keep looking while adding text
+ }
+ break;
+
+ case LOOKING_FOR_ST:
+ buffer[pos++] = (byte) data;
+ if (SECOND_ST_CHAR == data) {
+ String value = new String(buffer, startOfValue, (pos - 2) - startOfValue, Charset.defaultCharset());
+ options.add(value);
+ reset(processOperatingSystemCommand(options));
+ } else {
+ state = LOOKING_FOR_OSC_PARAM;
+ }
+ break;
+
+ case LOOKING_FOR_CHARSET:
+ options.add(Character.valueOf((char) data));
+ reset(processCharsetSelect(options));
+ break;
+ }
+
+ // Is it just too long?
+ if (pos >= buffer.length) {
+ reset(false);
+ }
+ return false; // expected diff with AnsiOutputStream.java
+ }
+
+ /**
+ * Resets all state to continue with regular parsing
+ * @param skipBuffer if current buffer should be skipped or written to out
+ */
+ private void reset(boolean skipBuffer) { // expected diff with AnsiOutputStream.java
+ if (!skipBuffer) {
+ ps.write(buffer, 0, pos); // expected diff with AnsiOutputStream.java
+ }
+ pos = 0;
+ startOfValue = 0;
+ options.clear();
+ state = LOOKING_FOR_FIRST_ESC_CHAR;
+ }
+
+ /**
+ * Helper for processEscapeCommand() to iterate over integer options
+ * @param optionsIterator the underlying iterator
+ * @throws IOException if no more non-null values left
+ */
+ private int getNextOptionInt(Iterator<Object> optionsIterator) throws IOException {
+ for (;;) {
+ if (!optionsIterator.hasNext())
+ throw new IllegalArgumentException();
+ Object arg = optionsIterator.next();
+ if (arg != null)
+ return (Integer) arg;
+ }
+ }
+
+ /**
+ *
+ * @param options
+ * @param command
+ * @return true if the escape command was processed.
+ */
+ private boolean processEscapeCommand(ArrayList<Object> options, int command) { // expected diff with AnsiOutputStream.java
+ try {
+ switch (command) {
+ case 'A':
+ processCursorUp(optionInt(options, 0, 1));
+ return true;
+ case 'B':
+ processCursorDown(optionInt(options, 0, 1));
+ return true;
+ case 'C':
+ processCursorRight(optionInt(options, 0, 1));
+ return true;
+ case 'D':
+ processCursorLeft(optionInt(options, 0, 1));
+ return true;
+ case 'E':
+ processCursorDownLine(optionInt(options, 0, 1));
+ return true;
+ case 'F':
+ processCursorUpLine(optionInt(options, 0, 1));
+ return true;
+ case 'G':
+ processCursorToColumn(optionInt(options, 0));
+ return true;
+ case 'H':
+ case 'f':
+ processCursorTo(optionInt(options, 0, 1), optionInt(options, 1, 1));
+ return true;
+ case 'J':
+ processEraseScreen(optionInt(options, 0, 0));
+ return true;
+ case 'K':
+ processEraseLine(optionInt(options, 0, 0));
+ return true;
+ case 'L':
+ processInsertLine(optionInt(options, 0, 1));
+ return true;
+ case 'M':
+ processDeleteLine(optionInt(options, 0, 1));
+ return true;
+ case 'S':
+ processScrollUp(optionInt(options, 0, 1));
+ return true;
+ case 'T':
+ processScrollDown(optionInt(options, 0, 1));
+ return true;
+ case 'm':
+ // Validate all options are ints...
+ for (Object next : options) {
+ if (next != null && next.getClass() != Integer.class) {
+ throw new IllegalArgumentException();
+ }
+ }
+
+ int count = 0;
+ Iterator<Object> optionsIterator = options.iterator();
+ while (optionsIterator.hasNext()) {
+ Object next = optionsIterator.next();
+ if (next != null) {
+ count++;
+ int value = (Integer) next;
+ if (30 <= value && value <= 37) {
+ processSetForegroundColor(value - 30);
+ } else if (40 <= value && value <= 47) {
+ processSetBackgroundColor(value - 40);
+ } else if (90 <= value && value <= 97) {
+ processSetForegroundColor(value - 90, true);
+ } else if (100 <= value && value <= 107) {
+ processSetBackgroundColor(value - 100, true);
+ } else if (value == 38 || value == 48) {
+ // extended color like `esc[38;5;<index>m` or `esc[38;2;<r>;<g>;<b>m`
+ int arg2or5 = getNextOptionInt(optionsIterator);
+ if (arg2or5 == 2) {
+ // 24 bit color style like `esc[38;2;<r>;<g>;<b>m`
+ int r = getNextOptionInt(optionsIterator);
+ int g = getNextOptionInt(optionsIterator);
+ int b = getNextOptionInt(optionsIterator);
+ if (r >= 0 && r <= 255 && g >= 0 && g <= 255 && b >= 0 && b <= 255) {
+ if (value == 38)
+ processSetForegroundColorExt(r, g, b);
+ else
+ processSetBackgroundColorExt(r, g, b);
+ } else {
+ throw new IllegalArgumentException();
+ }
+ }
+ else if (arg2or5 == 5) {
+ // 256 color style like `esc[38;5;<index>m`
+ int paletteIndex = getNextOptionInt(optionsIterator);
+ if (paletteIndex >= 0 && paletteIndex <= 255) {
+ if (value == 38)
+ processSetForegroundColorExt(paletteIndex);
+ else
+ processSetBackgroundColorExt(paletteIndex);
+ } else {
+ throw new IllegalArgumentException();
+ }
+ }
+ else {
+ throw new IllegalArgumentException();
+ }
+ } else {
+ switch (value) {
+ case 39:
+ processDefaultTextColor();
+ break;
+ case 49:
+ processDefaultBackgroundColor();
+ break;
+ case 0:
+ processAttributeRest();
+ break;
+ default:
+ processSetAttribute(value);
+ }
+ }
+ }
+ }
+ if (count == 0) {
+ processAttributeRest();
+ }
+ return true;
+ case 's':
+ processSaveCursorPosition();
+ return true;
+ case 'u':
+ processRestoreCursorPosition();
+ return true;
+
+ default:
+ if ('a' <= command && 'z' <= command) {
+ processUnknownExtension(options, command);
+ return true;
+ }
+ if ('A' <= command && 'Z' <= command) {
+ processUnknownExtension(options, command);
+ return true;
+ }
+ return false;
+ }
+ } catch (IllegalArgumentException ignore) {
+ } catch (IOException ioe) { // expected diff with AnsiOutputStream.java
+ setError(); // expected diff with AnsiOutputStream.java
+ }
+ return false;
+ }
+
+ /**
+ *
+ * @param options
+ * @return true if the operating system command was processed.
+ */
+ private boolean processOperatingSystemCommand(ArrayList<Object> options) { // expected diff with AnsiOutputStream.java
+ int command = optionInt(options, 0);
+ String label = (String) options.get(1);
+ // for command > 2 label could be composed (i.e. contain ';'), but we'll leave
+ // it to processUnknownOperatingSystemCommand implementations to handle that
+ try {
+ switch (command) {
+ case 0:
+ processChangeIconNameAndWindowTitle(label);
+ return true;
+ case 1:
+ processChangeIconName(label);
+ return true;
+ case 2:
+ processChangeWindowTitle(label);
+ return true;
+
+ default:
+ // not exactly unknown, but not supported through dedicated process methods:
+ processUnknownOperatingSystemCommand(command, label);
+ return true;
+ }
+ } catch (IllegalArgumentException ignore) {
+ }
+ return false;
+ }
+
+ /**
+ * Process <code>CSI u</code> ANSI code, corresponding to <code>RCP – Restore Cursor Position</code>
+ * @throws IOException IOException
+ */
+ protected void processRestoreCursorPosition() throws IOException {
+ }
+
+ /**
+ * Process <code>CSI s</code> ANSI code, corresponding to <code>SCP – Save Cursor Position</code>
+ * @throws IOException IOException
+ */
+ protected void processSaveCursorPosition() throws IOException {
+ }
+
+ /**
+ * Process <code>CSI L</code> ANSI code, corresponding to <code>IL – Insert Line</code>
+ * @param optionInt option
+ * @throws IOException IOException
+ * @since 1.16
+ */
+ protected void processInsertLine(int optionInt) throws IOException {
+ }
+
+ /**
+ * Process <code>CSI M</code> ANSI code, corresponding to <code>DL – Delete Line</code>
+ * @param optionInt option
+ * @throws IOException IOException
+ * @since 1.16
+ */
+ protected void processDeleteLine(int optionInt) throws IOException {
+ }
+
+ /**
+ * Process <code>CSI n T</code> ANSI code, corresponding to <code>SD – Scroll Down</code>
+ * @param optionInt option
+ * @throws IOException IOException
+ */
+ protected void processScrollDown(int optionInt) throws IOException {
+ }
+
+ /**
+ * Process <code>CSI n U</code> ANSI code, corresponding to <code>SU – Scroll Up</code>
+ * @param optionInt option
+ * @throws IOException IOException
+ */
+ protected void processScrollUp(int optionInt) throws IOException {
+ }
+
+ protected static final int ERASE_SCREEN_TO_END = 0;
+ protected static final int ERASE_SCREEN_TO_BEGINING = 1;
+ protected static final int ERASE_SCREEN = 2;
+
+ /**
+ * Process <code>CSI n J</code> ANSI code, corresponding to <code>ED – Erase in Display</code>
+ * @param eraseOption eraseOption
+ * @throws IOException IOException
+ */
+ protected void processEraseScreen(int eraseOption) throws IOException {
+ }
+
+ protected static final int ERASE_LINE_TO_END = 0;
+ protected static final int ERASE_LINE_TO_BEGINING = 1;
+ protected static final int ERASE_LINE = 2;
+
+ /**
+ * Process <code>CSI n K</code> ANSI code, corresponding to <code>ED – Erase in Line</code>
+ * @param eraseOption eraseOption
+ * @throws IOException IOException
+ */
+ protected void processEraseLine(int eraseOption) throws IOException {
+ }
+
+ protected static final int ATTRIBUTE_INTENSITY_BOLD = 1; // Intensity: Bold
+ protected static final int ATTRIBUTE_INTENSITY_FAINT = 2; // Intensity; Faint not widely supported
+ protected static final int ATTRIBUTE_ITALIC = 3; // Italic; on not widely supported. Sometimes treated as inverse.
+ protected static final int ATTRIBUTE_UNDERLINE = 4; // Underline; Single
+ protected static final int ATTRIBUTE_BLINK_SLOW = 5; // Blink; Slow less than 150 per minute
+ protected static final int ATTRIBUTE_BLINK_FAST = 6; // Blink; Rapid MS-DOS ANSI.SYS; 150 per minute or more
+ protected static final int ATTRIBUTE_NEGATIVE_ON = 7; // Image; Negative inverse or reverse; swap foreground and background
+ protected static final int ATTRIBUTE_CONCEAL_ON = 8; // Conceal on
+ protected static final int ATTRIBUTE_UNDERLINE_DOUBLE = 21; // Underline; Double not widely supported
+ protected static final int ATTRIBUTE_INTENSITY_NORMAL = 22; // Intensity; Normal not bold and not faint
+ protected static final int ATTRIBUTE_UNDERLINE_OFF = 24; // Underline; None
+ protected static final int ATTRIBUTE_BLINK_OFF = 25; // Blink; off
+ @Deprecated
+ protected static final int ATTRIBUTE_NEGATIVE_Off = 27; // Image; Positive
+ protected static final int ATTRIBUTE_NEGATIVE_OFF = 27; // Image; Positive
+ protected static final int ATTRIBUTE_CONCEAL_OFF = 28; // Reveal conceal off
+
+ /**
+ * process <code>SGR</code> other than <code>0</code> (reset), <code>30-39</code> (foreground),
+ * <code>40-49</code> (background), <code>90-97</code> (foreground high intensity) or
+ * <code>100-107</code> (background high intensity)
+ * @param attribute attribute
+ * @throws IOException IOException
+ * @see #processAttributeRest()
+ * @see #processSetForegroundColor(int)
+ * @see #processSetForegroundColor(int, boolean)
+ * @see #processSetForegroundColorExt(int)
+ * @see #processSetForegroundColorExt(int, int, int)
+ * @see #processDefaultTextColor()
+ * @see #processDefaultBackgroundColor()
+ */
+ protected void processSetAttribute(int attribute) throws IOException {
+ }
+
+ protected static final int BLACK = 0;
+ protected static final int RED = 1;
+ protected static final int GREEN = 2;
+ protected static final int YELLOW = 3;
+ protected static final int BLUE = 4;
+ protected static final int MAGENTA = 5;
+ protected static final int CYAN = 6;
+ protected static final int WHITE = 7;
+
+ /**
+ * process <code>SGR 30-37</code> corresponding to <code>Set text color (foreground)</code>.
+ * @param color the text color
+ * @throws IOException IOException
+ */
+ protected void processSetForegroundColor(int color) throws IOException {
+ processSetForegroundColor(color, false);
+ }
+
+ /**
+ * process <code>SGR 30-37</code> or <code>SGR 90-97</code> corresponding to
+ * <code>Set text color (foreground)</code> either in normal mode or high intensity.
+ * @param color the text color
+ * @param bright is high intensity?
+ * @throws IOException IOException
+ */
+ protected void processSetForegroundColor(int color, boolean bright) throws IOException {
+ }
+
+ /**
+ * process <code>SGR 38</code> corresponding to <code>extended set text color (foreground)</code>
+ * with a palette of 255 colors.
+ * @param paletteIndex the text color in the palette
+ * @throws IOException IOException
+ */
+ protected void processSetForegroundColorExt(int paletteIndex) throws IOException {
+ }
+
+ /**
+ * process <code>SGR 38</code> corresponding to <code>extended set text color (foreground)</code>
+ * with a 24 bits RGB definition of the color.
+ * @param r red
+ * @param g green
+ * @param b blue
+ * @throws IOException IOException
+ */
+ protected void processSetForegroundColorExt(int r, int g, int b) throws IOException {
+ }
+
+ /**
+ * process <code>SGR 40-47</code> corresponding to <code>Set background color</code>.
+ * @param color the background color
+ * @throws IOException IOException
+ */
+ protected void processSetBackgroundColor(int color) throws IOException {
+ processSetBackgroundColor(color, false);
+ }
+
+ /**
+ * process <code>SGR 40-47</code> or <code>SGR 100-107</code> corresponding to
+ * <code>Set background color</code> either in normal mode or high intensity.
+ * @param color the background color
+ * @param bright is high intensity?
+ * @throws IOException IOException
+ */
+ protected void processSetBackgroundColor(int color, boolean bright) throws IOException {
+ }
+
+ /**
+ * process <code>SGR 48</code> corresponding to <code>extended set background color</code>
+ * with a palette of 255 colors.
+ * @param paletteIndex the background color in the palette
+ * @throws IOException IOException
+ */
+ protected void processSetBackgroundColorExt(int paletteIndex) throws IOException {
+ }
+
+ /**
+ * process <code>SGR 48</code> corresponding to <code>extended set background color</code>
+ * with a 24 bits RGB definition of the color.
+ * @param r red
+ * @param g green
+ * @param b blue
+ * @throws IOException IOException
+ */
+ protected void processSetBackgroundColorExt(int r, int g, int b) throws IOException {
+ }
+
+ /**
+ * process <code>SGR 39</code> corresponding to <code>Default text color (foreground)</code>
+ * @throws IOException IOException
+ */
+ protected void processDefaultTextColor() throws IOException {
+ }
+
+ /**
+ * process <code>SGR 49</code> corresponding to <code>Default background color</code>
+ * @throws IOException IOException
+ */
+ protected void processDefaultBackgroundColor() throws IOException {
+ }
+
+ /**
+ * process <code>SGR 0</code> corresponding to <code>Reset / Normal</code>
+ * @throws IOException IOException
+ */
+ protected void processAttributeRest() throws IOException {
+ }
+
+ /**
+ * process <code>CSI n ; m H</code> corresponding to <code>CUP – Cursor Position</code> or
+ * <code>CSI n ; m f</code> corresponding to <code>HVP – Horizontal and Vertical Position</code>
+ * @param row row
+ * @param col col
+ * @throws IOException IOException
+ */
+ protected void processCursorTo(int row, int col) throws IOException {
+ }
+
+ /**
+ * process <code>CSI n G</code> corresponding to <code>CHA – Cursor Horizontal Absolute</code>
+ * @param x the column
+ * @throws IOException IOException
+ */
+ protected void processCursorToColumn(int x) throws IOException {
+ }
+
+ /**
+ * process <code>CSI n F</code> corresponding to <code>CPL – Cursor Previous Line</code>
+ * @param count line count
+ * @throws IOException IOException
+ */
+ protected void processCursorUpLine(int count) throws IOException {
+ }
+
+ /**
+ * process <code>CSI n E</code> corresponding to <code>CNL – Cursor Next Line</code>
+ * @param count line count
+ * @throws IOException IOException
+ */
+ protected void processCursorDownLine(int count) throws IOException {
+ // Poor mans impl..
+ for (int i = 0; i < count; i++) {
+ ps.write('\n'); // expected diff with AnsiOutputStream.java
+ }
+ }
+
+ /**
+ * process <code>CSI n D</code> corresponding to <code>CUB – Cursor Back</code>
+ * @param count count
+ * @throws IOException IOException
+ */
+ protected void processCursorLeft(int count) throws IOException {
+ }
+
+ /**
+ * process <code>CSI n C</code> corresponding to <code>CUF – Cursor Forward</code>
+ * @param count count
+ * @throws IOException IOException
+ */
+ protected void processCursorRight(int count) throws IOException {
+ // Poor mans impl..
+ for (int i = 0; i < count; i++) {
+ ps.write(' '); // expected diff with AnsiOutputStream.java
+ }
+ }
+
+ /**
+ * process <code>CSI n B</code> corresponding to <code>CUD – Cursor Down</code>
+ * @param count count
+ * @throws IOException IOException
+ */
+ protected void processCursorDown(int count) throws IOException {
+ }
+
+ /**
+ * process <code>CSI n A</code> corresponding to <code>CUU – Cursor Up</code>
+ * @param count count
+ * @throws IOException IOException
+ */
+ protected void processCursorUp(int count) throws IOException {
+ }
+
+ /**
+ * Process Unknown Extension
+ * @param options options
+ * @param command command
+ */
+ protected void processUnknownExtension(ArrayList<Object> options, int command) {
+ }
+
+ /**
+ * process <code>OSC 0;text BEL</code> corresponding to <code>Change Window and Icon label</code>
+ * @param label window title name
+ */
+ protected void processChangeIconNameAndWindowTitle(String label) {
+ processChangeIconName(label);
+ processChangeWindowTitle(label);
+ }
+
+ /**
+ * process <code>OSC 1;text BEL</code> corresponding to <code>Change Icon label</code>
+ * @param label icon label
+ */
+ protected void processChangeIconName(String label) {
+ }
+
+ /**
+ * process <code>OSC 2;text BEL</code> corresponding to <code>Change Window title</code>
+ * @param label window title text
+ */
+ protected void processChangeWindowTitle(String label) {
+ }
+
+ /**
+ * Process unknown <code>OSC</code> command.
+ * @param command command
+ * @param param param
+ */
+ protected void processUnknownOperatingSystemCommand(int command, String param) {
+ }
+
+ /**
+ * Process character set sequence.
+ * @param options options
+ * @return true if the charcter set select command was processed.
+ */
+ private boolean processCharsetSelect(ArrayList<Object> options) {
+ int set = optionInt(options, 0);
+ char seq = ((Character) options.get(1)).charValue();
+ processCharsetSelect(set, seq);
+ return true;
+ }
+
+ protected void processCharsetSelect(int set, char seq) {
+ }
+
+ private int optionInt(ArrayList<Object> options, int index) {
+ if (options.size() <= index)
+ throw new IllegalArgumentException();
+ Object value = options.get(index);
+ if (value == null)
+ throw new IllegalArgumentException();
+ if (!value.getClass().equals(Integer.class))
+ throw new IllegalArgumentException();
+ return (Integer) value;
+ }
+
+ private int optionInt(ArrayList<Object> options, int index, int defaultValue) {
+ if (options.size() > index) {
+ Object value = options.get(index);
+ if (value == null) {
+ return defaultValue;
+ }
+ return (Integer) value;
+ }
+ return defaultValue;
+ }
+
+ @Override
+ public void close() { // expected diff with AnsiOutputStream.java
+ print(RESET_CODE); // expected diff with AnsiOutputStream.java
+ flush();
+ super.close();
+ }
+
+}
=====================================
jansi/src/main/java/org/fusesource/jansi/FilterPrintStream.java
=====================================
@@ -0,0 +1,244 @@
+/*
+ * Copyright (C) 2009-2017 the original author(s).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.fusesource.jansi;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintStream;
+
+/**
+ * A PrintStream filtering to another PrintStream, without making any assumption about encoding.
+ *
+ * @author Hervé Boutemy
+ * @since 1.17
+ */
+public class FilterPrintStream extends PrintStream
+{
+ private static final String NEWLINE = System.getProperty("line.separator");
+ protected final PrintStream ps;
+
+ public FilterPrintStream(PrintStream ps)
+ {
+ super( new OutputStream() {
+
+ @Override
+ public void write(int b) throws IOException {
+ throw new RuntimeException("Direct OutputStream use forbidden: must go through delegate PrintStream");
+ }
+
+ });
+ this.ps = ps;
+ }
+
+ /**
+ * Filter the content
+ * @param data character to filter
+ * @return <code>true</code> if the data is not filtered then has to be printed to delegate PrintStream
+ */
+ protected boolean filter(int data)
+ {
+ return true;
+ }
+
+ @Override
+ public void write(int data)
+ {
+ if (filter(data))
+ {
+ ps.write(data);
+ }
+ }
+
+ @Override
+ public void write(byte[] buf, int off, int len)
+ {
+ for (int i = 0; i < len; i++)
+ {
+ write(buf[off + i]);
+ }
+ }
+
+ @Override
+ public boolean checkError()
+ {
+ return super.checkError() || ps.checkError();
+ }
+
+ @Override
+ public void close()
+ {
+ super.close();
+ ps.close();
+ }
+
+ @Override
+ public void flush()
+ {
+ super.flush();
+ ps.flush();
+ }
+
+ private void write(char buf[]) {
+ for (char c : buf)
+ {
+ if (filter(c))
+ {
+ ps.print(c);
+ }
+ }
+ }
+
+ private void write(String s) {
+ char[] buf = new char[s.length()];
+ s.getChars(0, s.length(), buf, 0);
+ write(buf);
+ }
+
+ private void newLine() {
+ write(NEWLINE);
+ }
+
+ /* Methods that do not terminate lines */
+
+ @Override
+ public void print(boolean b) {
+ write(b ? "true" : "false");
+ }
+
+ @Override
+ public void print(char c) {
+ write(String.valueOf(c));
+ }
+
+ @Override
+ public void print(int i) {
+ write(String.valueOf(i));
+ }
+
+ @Override
+ public void print(long l) {
+ write(String.valueOf(l));
+ }
+
+ @Override
+ public void print(float f) {
+ write(String.valueOf(f));
+ }
+
+ @Override
+ public void print(double d) {
+ write(String.valueOf(d));
+ }
+
+ @Override
+ public void print(char s[]) {
+ write(s);
+ }
+
+ @Override
+ public void print(String s) {
+ if (s == null) {
+ s = "null";
+ }
+ write(s);
+ }
+
+ @Override
+ public void print(Object obj) {
+ write(String.valueOf(obj));
+ }
+
+
+ /* Methods that do terminate lines */
+
+ @Override
+ public void println() {
+ newLine();
+ }
+
+ @Override
+ public void println(boolean x) {
+ synchronized (this) {
+ print(x);
+ newLine();
+ }
+ }
+
+ @Override
+ public void println(char x) {
+ synchronized (this) {
+ print(x);
+ newLine();
+ }
+ }
+
+ @Override
+ public void println(int x) {
+ synchronized (this) {
+ print(x);
+ newLine();
+ }
+ }
+
+ @Override
+ public void println(long x) {
+ synchronized (this) {
+ print(x);
+ newLine();
+ }
+ }
+
+ @Override
+ public void println(float x) {
+ synchronized (this) {
+ print(x);
+ newLine();
+ }
+ }
+
+ @Override
+ public void println(double x) {
+ synchronized (this) {
+ print(x);
+ newLine();
+ }
+ }
+
+ @Override
+ public void println(char x[]) {
+ synchronized (this) {
+ print(x);
+ newLine();
+ }
+ }
+
+ @Override
+ public void println(String x) {
+ synchronized (this) {
+ print(x);
+ newLine();
+ }
+ }
+
+ @Override
+ public void println(Object x) {
+ String s = String.valueOf(x);
+ synchronized (this) {
+ print(s);
+ newLine();
+ }
+ }
+}
=====================================
jansi/src/main/java/org/fusesource/jansi/WindowsAnsiOutputStream.java
=====================================
@@ -36,9 +36,8 @@ import static org.fusesource.jansi.internal.Kernel32.SetConsoleTextAttribute;
import static org.fusesource.jansi.internal.Kernel32.SetConsoleTitle;
import java.io.IOException;
-import java.io.OutputStream;
+import java.io.OutputStream; // expected diff with WindowsAnsiPrintStream.java
-import org.fusesource.jansi.internal.Kernel32;
import org.fusesource.jansi.internal.WindowsSupport;
import org.fusesource.jansi.internal.Kernel32.CONSOLE_SCREEN_BUFFER_INFO;
import org.fusesource.jansi.internal.Kernel32.COORD;
@@ -50,8 +49,10 @@ import org.fusesource.jansi.internal.Kernel32.COORD;
* @since 1.0
* @author <a href="http://hiramchirino.com">Hiram Chirino</a>
* @author Joris Kuipers
+ * @see WindowsAnsiPrintStream
+ * @deprecated use {@link WindowsAnsiPrintStream}, which does not suffer from encoding issues
*/
-public final class WindowsAnsiOutputStream extends AnsiOutputStream {
+public final class WindowsAnsiOutputStream extends AnsiOutputStream { // expected diff with WindowsAnsiPrintStream.java
private static final long console = GetStdHandle(STD_OUTPUT_HANDLE);
@@ -96,14 +97,14 @@ public final class WindowsAnsiOutputStream extends AnsiOutputStream {
private short savedX = -1;
private short savedY = -1;
- public WindowsAnsiOutputStream(OutputStream os) throws IOException {
- super(os);
+ public WindowsAnsiOutputStream(OutputStream os) throws IOException { // expected diff with WindowsAnsiPrintStream.java
+ super(os); // expected diff with WindowsAnsiPrintStream.java
getConsoleInfo();
originalColors = info.attributes;
}
private void getConsoleInfo() throws IOException {
- out.flush();
+ out.flush(); // expected diff with WindowsAnsiPrintStream.java
if (GetConsoleScreenBufferInfo(console, info) == 0) {
throw new IOException("Could not get the screen info: " + WindowsSupport.getLastErrorMessage());
}
@@ -113,7 +114,7 @@ public final class WindowsAnsiOutputStream extends AnsiOutputStream {
}
private void applyAttribute() throws IOException {
- out.flush();
+ out.flush(); // expected diff with WindowsAnsiPrintStream.java
short attributes = info.attributes;
if (negative) {
attributes = invertAttributeColors(attributes);
@@ -245,14 +246,18 @@ public final class WindowsAnsiOutputStream extends AnsiOutputStream {
@Override
protected void processSetForegroundColor(int color, boolean bright) throws IOException {
info.attributes = (short) ((info.attributes & ~0x0007) | ANSI_FOREGROUND_COLOR_MAP[color]);
- info.attributes = (short) ((info.attributes & ~FOREGROUND_INTENSITY) | (bright ? FOREGROUND_INTENSITY : 0));
+ if (bright) {
+ info.attributes |= FOREGROUND_INTENSITY;
+ }
applyAttribute();
}
@Override
protected void processSetBackgroundColor(int color, boolean bright) throws IOException {
info.attributes = (short) ((info.attributes & ~0x0070) | ANSI_BACKGROUND_COLOR_MAP[color]);
- info.attributes = (short) ((info.attributes & ~BACKGROUND_INTENSITY) | (bright ? BACKGROUND_INTENSITY : 0));
+ if (bright) {
+ info.attributes |= BACKGROUND_INTENSITY;
+ }
applyAttribute();
}
@@ -324,7 +329,7 @@ public final class WindowsAnsiOutputStream extends AnsiOutputStream {
protected void processRestoreCursorPosition() throws IOException {
// restore only if there was a save operation first
if (savedX != -1 && savedY != -1) {
- out.flush();
+ out.flush(); // expected diff with WindowsAnsiPrintStream.java
info.cursorPosition.x = savedX;
info.cursorPosition.y = savedY;
applyCursorPosition();
=====================================
jansi/src/main/java/org/fusesource/jansi/WindowsAnsiPrintStream.java
=====================================
@@ -0,0 +1,375 @@
+/*
+ * Copyright (C) 2009-2017 the original author(s).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.fusesource.jansi;
+
+import static org.fusesource.jansi.internal.Kernel32.BACKGROUND_BLUE;
+import static org.fusesource.jansi.internal.Kernel32.BACKGROUND_GREEN;
+import static org.fusesource.jansi.internal.Kernel32.BACKGROUND_INTENSITY;
+import static org.fusesource.jansi.internal.Kernel32.BACKGROUND_RED;
+import static org.fusesource.jansi.internal.Kernel32.CHAR_INFO;
+import static org.fusesource.jansi.internal.Kernel32.FOREGROUND_BLUE;
+import static org.fusesource.jansi.internal.Kernel32.FOREGROUND_GREEN;
+import static org.fusesource.jansi.internal.Kernel32.FOREGROUND_INTENSITY;
+import static org.fusesource.jansi.internal.Kernel32.FOREGROUND_RED;
+import static org.fusesource.jansi.internal.Kernel32.FillConsoleOutputAttribute;
+import static org.fusesource.jansi.internal.Kernel32.FillConsoleOutputCharacterW;
+import static org.fusesource.jansi.internal.Kernel32.GetConsoleScreenBufferInfo;
+import static org.fusesource.jansi.internal.Kernel32.GetStdHandle;
+import static org.fusesource.jansi.internal.Kernel32.SMALL_RECT;
+import static org.fusesource.jansi.internal.Kernel32.STD_OUTPUT_HANDLE;
+import static org.fusesource.jansi.internal.Kernel32.ScrollConsoleScreenBuffer;
+import static org.fusesource.jansi.internal.Kernel32.SetConsoleCursorPosition;
+import static org.fusesource.jansi.internal.Kernel32.SetConsoleTextAttribute;
+import static org.fusesource.jansi.internal.Kernel32.SetConsoleTitle;
+
+import java.io.IOException;
+import java.io.PrintStream; // expected diff with WindowsAnsiOutputStream.java
+
+import org.fusesource.jansi.internal.WindowsSupport;
+import org.fusesource.jansi.internal.Kernel32.CONSOLE_SCREEN_BUFFER_INFO;
+import org.fusesource.jansi.internal.Kernel32.COORD;
+
+/**
+ * A Windows ANSI escape processor, that uses JNA to access native platform
+ * API's to change the console attributes (see
+ * <a href="http://fusesource.github.io/jansi/documentation/native-api/index.html?org/fusesource/jansi/internal/Kernel32.html">Jansi native Kernel32</a>).
+ *
+ * @since 1.7
+ * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
+ * @author Joris Kuipers
+ * @see WindowsAnsiOutputStream
+ */
+public final class WindowsAnsiPrintStream extends AnsiPrintStream { // expected diff with WindowsAnsiOutputStream.java
+
+ private static final long console = GetStdHandle(STD_OUTPUT_HANDLE);
+
+ private static final short FOREGROUND_BLACK = 0;
+ private static final short FOREGROUND_YELLOW = (short) (FOREGROUND_RED | FOREGROUND_GREEN);
+ private static final short FOREGROUND_MAGENTA = (short) (FOREGROUND_BLUE | FOREGROUND_RED);
+ private static final short FOREGROUND_CYAN = (short) (FOREGROUND_BLUE | FOREGROUND_GREEN);
+ private static final short FOREGROUND_WHITE = (short) (FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
+
+ private static final short BACKGROUND_BLACK = 0;
+ private static final short BACKGROUND_YELLOW = (short) (BACKGROUND_RED | BACKGROUND_GREEN);
+ private static final short BACKGROUND_MAGENTA = (short) (BACKGROUND_BLUE | BACKGROUND_RED);
+ private static final short BACKGROUND_CYAN = (short) (BACKGROUND_BLUE | BACKGROUND_GREEN);
+ private static final short BACKGROUND_WHITE = (short) (BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE);
+
+ private static final short[] ANSI_FOREGROUND_COLOR_MAP = {
+ FOREGROUND_BLACK,
+ FOREGROUND_RED,
+ FOREGROUND_GREEN,
+ FOREGROUND_YELLOW,
+ FOREGROUND_BLUE,
+ FOREGROUND_MAGENTA,
+ FOREGROUND_CYAN,
+ FOREGROUND_WHITE,
+ };
+
+ private static final short[] ANSI_BACKGROUND_COLOR_MAP = {
+ BACKGROUND_BLACK,
+ BACKGROUND_RED,
+ BACKGROUND_GREEN,
+ BACKGROUND_YELLOW,
+ BACKGROUND_BLUE,
+ BACKGROUND_MAGENTA,
+ BACKGROUND_CYAN,
+ BACKGROUND_WHITE,
+ };
+
+ private final CONSOLE_SCREEN_BUFFER_INFO info = new CONSOLE_SCREEN_BUFFER_INFO();
+ private final short originalColors;
+
+ private boolean negative;
+ private short savedX = -1;
+ private short savedY = -1;
+
+ public WindowsAnsiPrintStream(PrintStream ps) throws IOException { // expected diff with WindowsAnsiOutputStream.java
+ super(ps); // expected diff with WindowsAnsiOutputStream.java
+ getConsoleInfo();
+ originalColors = info.attributes;
+ }
+
+ private void getConsoleInfo() throws IOException {
+ ps.flush(); // expected diff with WindowsAnsiOutputStream.java
+ if (GetConsoleScreenBufferInfo(console, info) == 0) {
+ throw new IOException("Could not get the screen info: " + WindowsSupport.getLastErrorMessage());
+ }
+ if (negative) {
+ info.attributes = invertAttributeColors(info.attributes);
+ }
+ }
+
+ private void applyAttribute() throws IOException {
+ ps.flush(); // expected diff with WindowsAnsiOutputStream.java
+ short attributes = info.attributes;
+ if (negative) {
+ attributes = invertAttributeColors(attributes);
+ }
+ if (SetConsoleTextAttribute(console, attributes) == 0) {
+ throw new IOException(WindowsSupport.getLastErrorMessage());
+ }
+ }
+
+ private short invertAttributeColors(short attributes) {
+ // Swap the the Foreground and Background bits.
+ int fg = 0x000F & attributes;
+ fg <<= 4;
+ int bg = 0X00F0 & attributes;
+ bg >>= 4;
+ attributes = (short) ((attributes & 0xFF00) | fg | bg);
+ return attributes;
+ }
+
+ private void applyCursorPosition() throws IOException {
+ if (SetConsoleCursorPosition(console, info.cursorPosition.copy()) == 0) {
+ throw new IOException(WindowsSupport.getLastErrorMessage());
+ }
+ }
+
+ @Override
+ protected void processEraseScreen(int eraseOption) throws IOException {
+ getConsoleInfo();
+ int[] written = new int[1];
+ switch (eraseOption) {
+ case ERASE_SCREEN:
+ COORD topLeft = new COORD();
+ topLeft.x = 0;
+ topLeft.y = info.window.top;
+ int screenLength = info.window.height() * info.size.x;
+ FillConsoleOutputAttribute(console, originalColors, screenLength, topLeft, written);
+ FillConsoleOutputCharacterW(console, ' ', screenLength, topLeft, written);
+ break;
+ case ERASE_SCREEN_TO_BEGINING:
+ COORD topLeft2 = new COORD();
+ topLeft2.x = 0;
+ topLeft2.y = info.window.top;
+ int lengthToCursor = (info.cursorPosition.y - info.window.top) * info.size.x
+ + info.cursorPosition.x;
+ FillConsoleOutputAttribute(console, originalColors, lengthToCursor, topLeft2, written);
+ FillConsoleOutputCharacterW(console, ' ', lengthToCursor, topLeft2, written);
+ break;
+ case ERASE_SCREEN_TO_END:
+ int lengthToEnd = (info.window.bottom - info.cursorPosition.y) * info.size.x +
+ (info.size.x - info.cursorPosition.x);
+ FillConsoleOutputAttribute(console, originalColors, lengthToEnd, info.cursorPosition.copy(), written);
+ FillConsoleOutputCharacterW(console, ' ', lengthToEnd, info.cursorPosition.copy(), written);
+ break;
+ default:
+ break;
+ }
+ }
+
+ @Override
+ protected void processEraseLine(int eraseOption) throws IOException {
+ getConsoleInfo();
+ int[] written = new int[1];
+ switch (eraseOption) {
+ case ERASE_LINE:
+ COORD leftColCurrRow = info.cursorPosition.copy();
+ leftColCurrRow.x = 0;
+ FillConsoleOutputAttribute(console, originalColors, info.size.x, leftColCurrRow, written);
+ FillConsoleOutputCharacterW(console, ' ', info.size.x, leftColCurrRow, written);
+ break;
+ case ERASE_LINE_TO_BEGINING:
+ COORD leftColCurrRow2 = info.cursorPosition.copy();
+ leftColCurrRow2.x = 0;
+ FillConsoleOutputAttribute(console, originalColors, info.cursorPosition.x, leftColCurrRow2, written);
+ FillConsoleOutputCharacterW(console, ' ', info.cursorPosition.x, leftColCurrRow2, written);
+ break;
+ case ERASE_LINE_TO_END:
+ int lengthToLastCol = info.size.x - info.cursorPosition.x;
+ FillConsoleOutputAttribute(console, originalColors, lengthToLastCol, info.cursorPosition.copy(), written);
+ FillConsoleOutputCharacterW(console, ' ', lengthToLastCol, info.cursorPosition.copy(), written);
+ break;
+ default:
+ break;
+ }
+ }
+
+ @Override
+ protected void processCursorLeft(int count) throws IOException {
+ getConsoleInfo();
+ info.cursorPosition.x = (short) Math.max(0, info.cursorPosition.x - count);
+ applyCursorPosition();
+ }
+
+ @Override
+ protected void processCursorRight(int count) throws IOException {
+ getConsoleInfo();
+ info.cursorPosition.x = (short) Math.min(info.window.width(), info.cursorPosition.x + count);
+ applyCursorPosition();
+ }
+
+ @Override
+ protected void processCursorDown(int count) throws IOException {
+ getConsoleInfo();
+ info.cursorPosition.y = (short) Math.min(Math.max(0, info.size.y - 1), info.cursorPosition.y + count);
+ applyCursorPosition();
+ }
+
+ @Override
+ protected void processCursorUp(int count) throws IOException {
+ getConsoleInfo();
+ info.cursorPosition.y = (short) Math.max(info.window.top, info.cursorPosition.y - count);
+ applyCursorPosition();
+ }
+
+ @Override
+ protected void processCursorTo(int row, int col) throws IOException {
+ getConsoleInfo();
+ info.cursorPosition.y = (short) Math.max(info.window.top, Math.min(info.size.y, info.window.top + row - 1));
+ info.cursorPosition.x = (short) Math.max(0, Math.min(info.window.width(), col - 1));
+ applyCursorPosition();
+ }
+
+ @Override
+ protected void processCursorToColumn(int x) throws IOException {
+ getConsoleInfo();
+ info.cursorPosition.x = (short) Math.max(0, Math.min(info.window.width(), x - 1));
+ applyCursorPosition();
+ }
+
+ @Override
+ protected void processSetForegroundColor(int color, boolean bright) throws IOException {
+ info.attributes = (short) ((info.attributes & ~0x0007) | ANSI_FOREGROUND_COLOR_MAP[color]);
+ if (bright) {
+ info.attributes |= FOREGROUND_INTENSITY;
+ }
+ applyAttribute();
+ }
+
+ @Override
+ protected void processSetBackgroundColor(int color, boolean bright) throws IOException {
+ info.attributes = (short) ((info.attributes & ~0x0070) | ANSI_BACKGROUND_COLOR_MAP[color]);
+ if (bright) {
+ info.attributes |= BACKGROUND_INTENSITY;
+ }
+ applyAttribute();
+ }
+
+ @Override
+ protected void processDefaultTextColor() throws IOException {
+ info.attributes = (short) ((info.attributes & ~0x000F) | (originalColors & 0xF));
+ info.attributes = (short) (info.attributes & ~FOREGROUND_INTENSITY);
+ applyAttribute();
+ }
+
+ @Override
+ protected void processDefaultBackgroundColor() throws IOException {
+ info.attributes = (short) ((info.attributes & ~0x00F0) | (originalColors & 0xF0));
+ info.attributes = (short) (info.attributes & ~BACKGROUND_INTENSITY);
+ applyAttribute();
+ }
+
+ @Override
+ protected void processAttributeRest() throws IOException {
+ info.attributes = (short) ((info.attributes & ~0x00FF) | originalColors);
+ this.negative = false;
+ applyAttribute();
+ }
+
+ @Override
+ protected void processSetAttribute(int attribute) throws IOException {
+ switch (attribute) {
+ case ATTRIBUTE_INTENSITY_BOLD:
+ info.attributes = (short) (info.attributes | FOREGROUND_INTENSITY);
+ applyAttribute();
+ break;
+ case ATTRIBUTE_INTENSITY_NORMAL:
+ info.attributes = (short) (info.attributes & ~FOREGROUND_INTENSITY);
+ applyAttribute();
+ break;
+
+ // Yeah, setting the background intensity is not underlining.. but it's best we can do
+ // using the Windows console API
+ case ATTRIBUTE_UNDERLINE:
+ info.attributes = (short) (info.attributes | BACKGROUND_INTENSITY);
+ applyAttribute();
+ break;
+ case ATTRIBUTE_UNDERLINE_OFF:
+ info.attributes = (short) (info.attributes & ~BACKGROUND_INTENSITY);
+ applyAttribute();
+ break;
+
+ case ATTRIBUTE_NEGATIVE_ON:
+ negative = true;
+ applyAttribute();
+ break;
+ case ATTRIBUTE_NEGATIVE_OFF:
+ negative = false;
+ applyAttribute();
+ break;
+ default:
+ break;
+ }
+ }
+
+ @Override
+ protected void processSaveCursorPosition() throws IOException {
+ getConsoleInfo();
+ savedX = info.cursorPosition.x;
+ savedY = info.cursorPosition.y;
+ }
+
+ @Override
+ protected void processRestoreCursorPosition() throws IOException {
+ // restore only if there was a save operation first
+ if (savedX != -1 && savedY != -1) {
+ ps.flush(); // expected diff with WindowsAnsiOutputStream.java
+ info.cursorPosition.x = savedX;
+ info.cursorPosition.y = savedY;
+ applyCursorPosition();
+ }
+ }
+
+ @Override
+ protected void processInsertLine(int optionInt) throws IOException {
+ getConsoleInfo();
+ SMALL_RECT scroll = info.window.copy();
+ scroll.top = info.cursorPosition.y;
+ COORD org = new COORD();
+ org.x = 0;
+ org.y = (short)(info.cursorPosition.y + optionInt);
+ CHAR_INFO info = new CHAR_INFO();
+ info.attributes = originalColors;
+ info.unicodeChar = ' ';
+ if (ScrollConsoleScreenBuffer(console, scroll, scroll, org, info) == 0) {
+ throw new IOException(WindowsSupport.getLastErrorMessage());
+ }
+ }
+
+ @Override
+ protected void processDeleteLine(int optionInt) throws IOException {
+ getConsoleInfo();
+ SMALL_RECT scroll = info.window.copy();
+ scroll.top = info.cursorPosition.y;
+ COORD org = new COORD();
+ org.x = 0;
+ org.y = (short)(info.cursorPosition.y - optionInt);
+ CHAR_INFO info = new CHAR_INFO();
+ info.attributes = originalColors;
+ info.unicodeChar = ' ';
+ if (ScrollConsoleScreenBuffer(console, scroll, scroll, org, info) == 0) {
+ throw new IOException(WindowsSupport.getLastErrorMessage());
+ }
+ }
+
+ @Override
+ protected void processChangeWindowTitle(String label) {
+ SetConsoleTitle(label);
+ }
+}
=====================================
jansi/src/main/resources/org/fusesource/jansi/jansi.txt
=====================================
@@ -0,0 +1,8 @@
+[?7h[255D[40m
+[0;1;33m[22C[32m┌──┐┌─────┐ ┌─────┐ ┌──────┬──┐
+[22C│[37m██[32m├┘[37m█████[32m└┬┘[37m█████[32m└┬┘[37m██████[32m│[37m̦[32m│
+[17C┌──┐ │[37m██[32m│[37m██▄▄▄██[32m│[37m██[32m┌─┐[37m██[32m│[37m██▄▄▄▄ [32m│[37m▄▄[32m│
+[17C│[37m▒▒[32m└─┘[37m▒█[32m│[37m▒█[32m┌─┐[37m▒█[32m│[37m▒█[32m│ │[37m▒█[32m│ [37m▀▀▀▀▒█[32m│[37m▒█[32m│
+[17C└┐[37m▓▓▓▓▓[32m┌┤[37m▓▓[32m│ │[37m▓▓[32m│[37m▓▓[32m│ │[37m▓▓[32m│[37m▀▓▓▓▓▓▀[32m│[37m▓▓[32m│
+[18C└─────┘└──┘ └──┴──┘ └──┴───────┴──┘
+[0m
=====================================
jansi/src/test/java/org/fusesource/jansi/AnsiConsoleExample3.java deleted
=====================================
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2009-2017 the original author(s).
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.fusesource.jansi;
-
-import java.io.IOException;
-import java.nio.charset.Charset;
-
-/**
- * Quick test to show issues with non-ascii characters on Windows when using AnsiConsole.
- * Not really battle-tested for any Windows encoding, but you can update
- */
-public class AnsiConsoleExample3 {
-
- private final static String NON_ASCII = "éèä";
- private AnsiConsoleExample3() {
- }
-
- public static void main(String[] args) throws IOException {
- System.out.println("Platform: " + System.getProperty("os.name"));
- System.out.println("Platform encoding: " + Charset.defaultCharset());
- System.out.println("System.out: " + NON_ASCII);
- AnsiConsole.out.println("AnsiConsole.out: " + NON_ASCII);
- }
-
-}
\ No newline at end of file
=====================================
jansi/src/test/java/org/fusesource/jansi/AnsiStringTest.java
=====================================
@@ -26,7 +26,7 @@ import static org.junit.Assert.assertEquals;
*/
public class AnsiStringTest {
@Test
- public void testNotEncoded() throws Exception {
+ public void testNotEncoded() {
AnsiString as = new AnsiString("foo");
assertEquals("foo", as.getEncoded());
assertEquals("foo", as.getPlain());
@@ -34,9 +34,15 @@ public class AnsiStringTest {
}
@Test
- public void testEncoded() throws Exception {
+ public void testEncoded() {
AnsiString as = new AnsiString(Ansi.ansi().a(Ansi.Attribute.INTENSITY_BOLD).a("foo").reset().toString());
assertEquals("foo", as.getPlain());
assertEquals(3, as.length());
}
+
+ @Test
+ public void testCursorPosition() {
+ Ansi ansi = Ansi.ansi().cursor( 3, 6 ).reset();
+ assertEquals("\u001B[3;6H\u001B[m", ansi.toString());
+ }
}
\ No newline at end of file
=====================================
jansi/src/test/java/org/fusesource/jansi/FilterPrintStreamTest.java
=====================================
@@ -0,0 +1,30 @@
+package org.fusesource.jansi;
+
+import java.io.OutputStream;
+import java.io.PrintStream;
+
+import org.junit.Test;
+
+public class FilterPrintStreamTest
+{
+ @Test
+ public void testPrintMethods()
+ throws Exception
+ {
+ PrintStream ps = new FilterPrintStream(System.out);
+ ps.println("String");
+ ps.println('€');
+ ps.flush();
+ }
+
+ @Test
+ public void testWrite()
+ throws Exception
+ {
+ OutputStream os = new FilterPrintStream(System.out);
+ os.write('A');
+ os.write('B');
+ os.write("€".getBytes() );
+ os.flush();
+ }
+}
\ No newline at end of file
=====================================
jansi/src/test/java/org/fusesource/jansi/HtmlAnsiOutputStreamTest.java
=====================================
@@ -76,6 +76,12 @@ public class HtmlAnsiOutputStreamTest {
colorize("[1m\u3053\u3093\u306b\u3061\u306f"));
}
+ @Test
+ public void testResetCharacterSet() throws IOException {
+ assertEquals(colorize("(\033(0)"), "()");
+ assertEquals(colorize("(\033)0)"), "()");
+ }
+
private String colorize(String text) throws IOException {
ByteArrayOutputStream os = new ByteArrayOutputStream();
HtmlAnsiOutputStream hos = new HtmlAnsiOutputStream(os);
=====================================
pom.xml
=====================================
@@ -25,7 +25,7 @@
<groupId>org.fusesource.jansi</groupId>
<artifactId>jansi-project</artifactId>
- <version>1.16</version>
+ <version>1.17.1</version>
<packaging>pom</packaging>
<name>${project.artifactId}</name>
@@ -36,7 +36,7 @@
<forge-project-id-uc>JANSI</forge-project-id-uc>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <jansi-native-version>1.7</jansi-native-version>
+ <jansi-native-version>1.8</jansi-native-version>
<scalate-version>1.5.1</scalate-version>
<scalamd-version>1.5</scalamd-version>
<slf4j-version>1.6.1</slf4j-version>
@@ -82,7 +82,7 @@
<connection>scm:git:https://github.com/fusesource/${forge-project-id}.git</connection>
<developerConnection>scm:git:https://github.com/fusesource/${forge-project-id}.git</developerConnection>
<url>https://github.com/fusesource/${forge-project-id}/tree/${project.scm.tag}</url>
- <tag>jansi-project-1.16</tag>
+ <tag>jansi-project-1.17.1</tag>
</scm>
<distributionManagement>
@@ -230,7 +230,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
- <version>3.0.0</version>
+ <version>2.5</version>
<configuration>
<linkJavadoc>true</linkJavadoc>
<docTitle>${project.name} Source Xref (${project.version})</docTitle>
View it on GitLab: https://salsa.debian.org/java-team/jansi/compare/9cb6eadc6399631e2feb6e265e8a931bfe7406fc...fdb19f4f315322151ad55d77d5815fecedc58692
--
View it on GitLab: https://salsa.debian.org/java-team/jansi/compare/9cb6eadc6399631e2feb6e265e8a931bfe7406fc...fdb19f4f315322151ad55d77d5815fecedc58692
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20190216/7e65b959/attachment.html>
More information about the pkg-java-commits
mailing list