|
|
|
@ -168,20 +168,8 @@ public class SigTerm{ |
|
|
|
|
System.out.println(RESET); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void RefreshScreen() { |
|
|
|
|
CursorLineDown(1); |
|
|
|
|
ScrollUp(1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
|
static void HandleInput(NonBlockingReader r) { |
|
|
|
|
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) { |
|
|
|
|
if (!is27&&!is91&&ch==27) { |
|
|
|
@ -215,8 +203,32 @@ public class SigTerm{ |
|
|
|
|
} |
|
|
|
|
r.read(); |
|
|
|
|
} |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void Run(NonBlockingReader r) { |
|
|
|
|
while (RUNNING) { |
|
|
|
|
HandleInput(r); |
|
|
|
|
RefreshScreen(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void RefreshScreen() { |
|
|
|
|
CursorLineDown(1); |
|
|
|
|
ScrollUp(1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
Run(r); |
|
|
|
|
r.shutdown(); |
|
|
|
|
term.close(); |
|
|
|
|
} catch (IOException e) { |
|
|
|
|