diff --git a/SigTerm.jar b/SigTerm.jar index f5d0223..797119b 100644 Binary files a/SigTerm.jar and b/SigTerm.jar differ diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..667ce44 --- /dev/null +++ b/pom.xml @@ -0,0 +1,97 @@ + + + + 4.0.0 + + SigTerm + SigTerm + 0 + + SigTerm + + + UTF-8 + 1.8 + 1.8 + + + + + + jline + jline + 3.0.0.M1 + + + + + src + + + + + maven-clean-plugin + 3.1.0 + + + + maven-resources-plugin + 3.0.2 + + + maven-compiler-plugin + 3.8.0 + + + maven-surefire-plugin + 2.22.1 + + + maven-jar-plugin + 3.0.2 + + + maven-install-plugin + 2.5.2 + + + maven-deploy-plugin + 2.8.2 + + + + maven-site-plugin + 3.7.1 + + + maven-project-info-reports-plugin + 3.0.0 + + + maven-assembly-plugin + + + + sig.SigTerm + + + + jar-with-dependencies + + false + + + + make-assembly + package + + single + + + + + + + + \ No newline at end of file diff --git a/run b/run index 6f70b11..77b3071 100755 --- a/run +++ b/run @@ -1,6 +1,2 @@ -javac --release 8 src/sig/*.java -d bin -cd bin -jar cfe ../SigTerm.jar sig.SigTerm sig -cd .. -clear -java -cp bin sig/SigTerm \ No newline at end of file +mvn clean compile assembly:single +java -jar target/SigTerm-0.jar \ No newline at end of file diff --git a/src/sig/SigTerm.java b/src/sig/SigTerm.java index fffa8cb..2f63a67 100644 --- a/src/sig/SigTerm.java +++ b/src/sig/SigTerm.java @@ -1,6 +1,12 @@ package sig; +import java.util.Scanner; +import java.util.regex.Pattern; +import org.jline.terminal.TerminalBuilder; + public class SigTerm{ + static Thread t; + static String storedVal=""; final static String ESC = "\u001b"; final static String CSI = "["; final static String CSICODE = ESC+CSI; @@ -104,6 +110,9 @@ public class SigTerm{ public static void Reset() { System.out.print(CSICODE+"0m"); } + public static void GetCursorPosition() { + System.out.print(CSICODE+"6n"); + } /** Prints text to the console at the current cursor position. **/ @@ -140,6 +149,12 @@ public class SigTerm{ BackgroundColor(0,125,125); UnderlineColor(255,0,0); Text("A little purple!"); + CursorLineDown(2); + CursorSetPosition(999999,1); + System.out.println(org.jline.terminal.TerminalBuilder.terminal().getWidth()); + GetCursorPosition(); + TextColor(0,255,0); + CursorSetPosition(1,8); System.out.println(RESET); } } \ No newline at end of file diff --git a/target/SigTerm-0.jar b/target/SigTerm-0.jar new file mode 100644 index 0000000..0145eaf Binary files /dev/null and b/target/SigTerm-0.jar differ diff --git a/target/classes/sig/SigTerm.class b/target/classes/sig/SigTerm.class new file mode 100644 index 0000000..56a4d89 Binary files /dev/null and b/target/classes/sig/SigTerm.class differ diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..82e0358 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1 @@ +sig/SigTerm.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..af2c02f --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1 @@ +/workspace/SigTerm/src/sig/SigTerm.java