diff --git a/run b/run index f1b5521..8d201db 100755 --- a/run +++ b/run @@ -1,2 +1,2 @@ mvn clean compile assembly:single -java -jar target/SigTerm-0.jar +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 1bb79f9..8520c42 100644 --- a/src/sig/SigTerm.java +++ b/src/sig/SigTerm.java @@ -1,10 +1,13 @@ package sig; import java.io.IOException; +import java.io.Reader; import org.jline.terminal.Terminal; +import org.jline.utils.NonBlockingReader; public class SigTerm{ + static boolean RUNNING=true; static String storedVal=""; final static String ESC = "\u001b"; final static String CSI = "["; @@ -159,7 +162,6 @@ public class SigTerm{ Text(DIM+MAGENTA+BLACK_BACKGROUND+"A little purple!"); CursorLineDown(2); CursorSetPosition(999999,1); - GetCursorPosition(); CursorSetPosition(1,8); System.out.println(RESET); } @@ -167,9 +169,22 @@ public class SigTerm{ public static void main(String[] args) { try { Terminal term = org.jline.terminal.TerminalBuilder.terminal(); + term.enterRawMode(); + NonBlockingReader r = term.reader(); System.out.println(term.getWidth()+"x"+term.getHeight()+" size detected."); System.out.println("Done!"); RunTest(); + while (RUNNING) { + int ch = r.peek(250); + if (ch!=NonBlockingReader.READ_EXPIRED) { + Text(Integer.toString(r.read())); + } else { + Text("..."); + } + CursorLineDown(1); + ScrollUp(1); + } + r.shutdown(); term.close(); } catch (IOException e) { diff --git a/target/SigTerm-0.jar b/target/SigTerm-0.jar index e3b61a3..39b15e8 100644 Binary files a/target/SigTerm-0.jar and b/target/SigTerm-0.jar differ diff --git a/target/classes/sig/SigTerm.class b/target/classes/sig/SigTerm.class index a638c53..2b41b80 100644 Binary files a/target/classes/sig/SigTerm.class 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 index 0191c5d..82e0358 100644 --- a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -1 +1 @@ -sig\SigTerm.class +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 index 30a54f2..af2c02f 100644 --- a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -1 +1 @@ -C:\Users\sigon\Documents\SigTerm\src\sig\SigTerm.java +/workspace/SigTerm/src/sig/SigTerm.java