ParsedLine
objects are returned by the {@link Parser}
15 | * during completion or when accepting the line.
16 | *
17 | * The instances should implement the {@link CompletingParsedLine}
18 | * interface so that escape chars and quotes can be correctly handled.
19 | *
20 | * @see Parser
21 | * @see CompletingParsedLine
22 | */
23 | public interface ParsedLine {
24 |
25 | /**
26 | * The current word being completed.
27 | * If the cursor is after the last word, an empty string is returned.
28 | *
29 | * @return the word being completed or an empty string
30 | */
31 | String word();
32 |
33 | /**
34 | * The cursor position within the current word.
35 | *
36 | * @return the cursor position within the current word
37 | */
38 | int wordCursor();
39 |
40 | /**
41 | * The index of the current word in the list of words.
42 | *
43 | * @return the index of the current word in the list of words
44 | */
45 | int wordIndex();
46 |
47 | /**
48 | * The list of words.
49 | *
50 | * @return the list of words
51 | */
52 | List44 | * Note each row has {@code col+1} different column positions, 45 | * including the right margin. 46 | *
47 | * 48 | * @param col the new column 49 | * @param row the new row 50 | * @return the cursor position 51 | */ 52 | public int cursorPos(int row, int col) { 53 | return row * (cols+1) + col; 54 | } 55 | 56 | public void copy(Size size) { 57 | setColumns(size.getColumns()); 58 | setRows(size.getRows()); 59 | } 60 | 61 | @Override 62 | public boolean equals(Object o) { 63 | if (o instanceof Size) { 64 | Size size = (Size) o; 65 | return rows == size.rows && cols == size.cols; 66 | } else { 67 | return false; 68 | } 69 | } 70 | 71 | @Override 72 | public int hashCode() { 73 | return rows * 31 + cols; 74 | } 75 | 76 | @Override 77 | public String toString() { 78 | return "Size[" + "cols=" + cols + ", rows=" + rows + ']'; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/java/org/jline/terminal/impl/AbstractWindowsConsoleWriter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002-2017, the original author or authors. 3 | * 4 | * This software is distributable under the BSD license. See the terms of the 5 | * BSD license in the documentation provided with this software. 6 | * 7 | * https://opensource.org/licenses/BSD-3-Clause 8 | */ 9 | package org.jline.terminal.impl; 10 | 11 | import java.io.IOException; 12 | import java.io.Writer; 13 | 14 | public abstract class AbstractWindowsConsoleWriter extends Writer { 15 | 16 | protected abstract void writeConsole(char[] text, int len) throws IOException; 17 | 18 | @Override 19 | public void write(char[] cbuf, int off, int len) throws IOException { 20 | char[] text = cbuf; 21 | if (off != 0) { 22 | text = new char[len]; 23 | System.arraycopy(cbuf, off, text, 0, len); 24 | } 25 | 26 | synchronized (this.lock) { 27 | writeConsole(text, len); 28 | } 29 | } 30 | 31 | @Override 32 | public void flush() { 33 | } 34 | 35 | @Override 36 | public void close() { 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/java/org/jline/terminal/impl/NativeSignalHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002-2016, the original author or authors. 3 | * 4 | * This software is distributable under the BSD license. See the terms of the 5 | * BSD license in the documentation provided with this software. 6 | * 7 | * https://opensource.org/licenses/BSD-3-Clause 8 | */ 9 | package org.jline.terminal.impl; 10 | 11 | import org.jline.terminal.Terminal.Signal; 12 | import org.jline.terminal.Terminal.SignalHandler; 13 | 14 | public final class NativeSignalHandler implements SignalHandler { 15 | 16 | public static final NativeSignalHandler SIG_DFL = new NativeSignalHandler(); 17 | 18 | public static final NativeSignalHandler SIG_IGN = new NativeSignalHandler(); 19 | 20 | private NativeSignalHandler() { 21 | } 22 | 23 | public void handle(Signal signal) { 24 | throw new UnsupportedOperationException(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/java/org/jline/terminal/impl/jansi/win/JansiWinConsoleWriter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002-2017, the original author or authors. 3 | * 4 | * This software is distributable under the BSD license. See the terms of the 5 | * BSD license in the documentation provided with this software. 6 | * 7 | * https://opensource.org/licenses/BSD-3-Clause 8 | */ 9 | package org.jline.terminal.impl.jansi.win; 10 | 11 | import org.fusesource.jansi.internal.WindowsSupport; 12 | import org.jline.terminal.impl.AbstractWindowsConsoleWriter; 13 | 14 | import java.io.IOException; 15 | 16 | import static org.fusesource.jansi.internal.Kernel32.GetStdHandle; 17 | import static org.fusesource.jansi.internal.Kernel32.STD_OUTPUT_HANDLE; 18 | import static org.fusesource.jansi.internal.Kernel32.WriteConsoleW; 19 | 20 | class JansiWinConsoleWriter extends AbstractWindowsConsoleWriter { 21 | 22 | private static final long console = GetStdHandle(STD_OUTPUT_HANDLE); 23 | private final int[] writtenChars = new int[1]; 24 | 25 | @Override 26 | protected void writeConsole(char[] text, int len) throws IOException { 27 | if (WriteConsoleW(console, text, len, writtenChars, 0) == 0) { 28 | throw new IOException("Failed to write to console: " + WindowsSupport.getLastErrorMessage()); 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/java/org/jline/terminal/impl/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002-2016, the original author or authors. 3 | * 4 | * This software is distributable under the BSD license. See the terms of the 5 | * BSD license in the documentation provided with this software. 6 | * 7 | * https://opensource.org/licenses/BSD-3-Clause 8 | */ 9 | /** 10 | * JLine 3. 11 | * 12 | * @since 3.0 13 | */ 14 | package org.jline.terminal.impl; -------------------------------------------------------------------------------- /xpocket-jline/src/main/java/org/jline/terminal/spi/JansiSupport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002-2020, the original author or authors. 3 | * 4 | * This software is distributable under the BSD license. See the terms of the 5 | * BSD license in the documentation provided with this software. 6 | * 7 | * https://opensource.org/licenses/BSD-3-Clause 8 | */ 9 | package org.jline.terminal.spi; 10 | 11 | import org.jline.terminal.Attributes; 12 | import org.jline.terminal.Size; 13 | import org.jline.terminal.Terminal; 14 | 15 | import java.io.IOException; 16 | import java.nio.charset.Charset; 17 | 18 | public interface JansiSupport { 19 | 20 | Pty current() throws IOException; 21 | 22 | Pty open(Attributes attributes, Size size) throws IOException; 23 | 24 | Terminal winSysTerminal(String name, String type, boolean ansiPassThrough, Charset encoding, int codepage, boolean nativeSignals, Terminal.SignalHandler signalHandler) throws IOException; 25 | 26 | Terminal winSysTerminal(String name, String type, boolean ansiPassThrough, Charset encoding, int codepage, boolean nativeSignals, Terminal.SignalHandler signalHandler, boolean paused) throws IOException; 27 | 28 | boolean isWindowsConsole(); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/java/org/jline/terminal/spi/JnaSupport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002-2020, the original author or authors. 3 | * 4 | * This software is distributable under the BSD license. See the terms of the 5 | * BSD license in the documentation provided with this software. 6 | * 7 | * https://opensource.org/licenses/BSD-3-Clause 8 | */ 9 | package org.jline.terminal.spi; 10 | 11 | import org.jline.terminal.Attributes; 12 | import org.jline.terminal.Size; 13 | import org.jline.terminal.Terminal; 14 | 15 | import java.io.IOException; 16 | import java.nio.charset.Charset; 17 | 18 | public interface JnaSupport { 19 | 20 | Pty current() throws IOException; 21 | 22 | Pty open(Attributes attributes, Size size) throws IOException; 23 | 24 | Terminal winSysTerminal(String name, String type, boolean ansiPassThrough, Charset encoding, int codepage, boolean nativeSignals, Terminal.SignalHandler signalHandler) throws IOException; 25 | 26 | Terminal winSysTerminal(String name, String type, boolean ansiPassThrough, Charset encoding, int codepage, boolean nativeSignals, Terminal.SignalHandler signalHandler, boolean paused) throws IOException; 27 | 28 | boolean isWindowsConsole(); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/java/org/jline/terminal/spi/Pty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002-2016, the original author or authors. 3 | * 4 | * This software is distributable under the BSD license. See the terms of the 5 | * BSD license in the documentation provided with this software. 6 | * 7 | * https://opensource.org/licenses/BSD-3-Clause 8 | */ 9 | package org.jline.terminal.spi; 10 | 11 | import java.io.Closeable; 12 | import java.io.IOException; 13 | import java.io.InputStream; 14 | import java.io.OutputStream; 15 | 16 | import org.jline.terminal.Attributes; 17 | import org.jline.terminal.Size; 18 | 19 | public interface Pty extends Closeable { 20 | 21 | InputStream getMasterInput() throws IOException; 22 | 23 | OutputStream getMasterOutput() throws IOException; 24 | 25 | InputStream getSlaveInput() throws IOException; 26 | 27 | OutputStream getSlaveOutput() throws IOException; 28 | 29 | Attributes getAttr() throws IOException; 30 | 31 | void setAttr(Attributes attr) throws IOException; 32 | 33 | Size getSize() throws IOException; 34 | 35 | void setSize(Size size) throws IOException; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/java/org/jline/utils/ClosedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002-2016, the original author or authors. 3 | * 4 | * This software is distributable under the BSD license. See the terms of the 5 | * BSD license in the documentation provided with this software. 6 | * 7 | * https://opensource.org/licenses/BSD-3-Clause 8 | */ 9 | package org.jline.utils; 10 | 11 | import java.io.IOException; 12 | 13 | public class ClosedException extends IOException { 14 | 15 | private static final long serialVersionUID = 3085420657077696L; 16 | 17 | public ClosedException() { 18 | } 19 | 20 | public ClosedException(String message) { 21 | super(message); 22 | } 23 | 24 | public ClosedException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | 28 | public ClosedException(Throwable cause) { 29 | super(cause); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/java/org/jline/utils/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002-2016, the original author or authors. 3 | * 4 | * This software is distributable under the BSD license. See the terms of the 5 | * BSD license in the documentation provided with this software. 6 | * 7 | * https://opensource.org/licenses/BSD-3-Clause 8 | */ 9 | /** 10 | * JLine 3. 11 | * 12 | * @since 3.0 13 | */ 14 | package org.jline.utils; -------------------------------------------------------------------------------- /xpocket-jline/src/main/resources/META-INF/native-image/jline/resource-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "resources": [ 3 | {"pattern": "org/jline/utils/.*"} 4 | ] 5 | } -------------------------------------------------------------------------------- /xpocket-jline/src/main/resources/META-INF/services/org.jline.terminal.spi.JansiSupport: -------------------------------------------------------------------------------- 1 | org.jline.terminal.impl.jansi.JansiSupportImpl 2 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/resources/jline/console/completer/CandidateListCompletionHandler.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2002-2016, the original author or authors. 3 | # 4 | # This software is distributable under the BSD license. See the terms of the 5 | # BSD license in the documentation provided with this software. 6 | # 7 | # http://www.opensource.org/licenses/bsd-license.php 8 | # 9 | 10 | DISPLAY_CANDIDATES=Display all %d possibilities? (y or n) 11 | DISPLAY_CANDIDATES_YES=y 12 | DISPLAY_CANDIDATES_NO=n 13 | DISPLAY_MORE=--More-- 14 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/resources/org/jline/builtins/nano-browser-help.txt: -------------------------------------------------------------------------------- 1 | File Browser Help Text 2 | 3 | The file browser is used to visually browse the directory structure to select a file for reading or writing. You may use the arrow keys or Page Up/Down to browse through the files, and S or Enter to choose the selected file or enter the selected directory. To move up one level, select the directory called ".." at the top of the file list. 4 | 5 | The following function keys are available in the file browser: 6 | 7 | ^G (F1) Display this help text 8 | ^X (F2) Exit from the file browser 9 | ^W Search for a string or a regular expression 10 | (F16) (M-W) Repeat last search 11 | ^Y (F7) Move to the previous screen 12 | ^V (F8) Move to the next screen 13 | M-\ (M-|) Go to the first file in the list 14 | M-/ (M-?) Go to the last file in the list 15 | ^_ (F13) (M-G) Go to directory 16 | 17 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/resources/org/jline/builtins/nano-goto-help.txt: -------------------------------------------------------------------------------- 1 | Go To Line Help Text 2 | 3 | Enter the line number that you wish to go to and hit Enter. If there are 4 | fewer lines of text than the number you entered, you will be brought to 5 | the last line of the file. 6 | 7 | The following function keys are available in Go To Line mode: 8 | 9 | ^G (F1) Display this help text 10 | ^C Cancel the current function 11 | ^Y Go to the first line of the file 12 | ^V Go to the last line of the file 13 | 14 | ^T Search for a string or a regular expression 15 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/resources/org/jline/builtins/nano-read-help.txt: -------------------------------------------------------------------------------- 1 | Insert File Help Text 2 | 3 | Type in the name of a file to be inserted into the current file buffer at the current cursor location. 4 | 5 | The following function keys are available in Insert File mode: 6 | 7 | ^G (F1) Display this help text 8 | ^C Cancel the current function 9 | ^T Go to file browser 10 | ^X Execute external command 11 | M-F Toggle the use of a new buffer 12 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/resources/org/jline/builtins/nano-replace-help.txt: -------------------------------------------------------------------------------- 1 | 2 | Search Command Help Text 3 | 4 | Enter the words or characters you would like to search for, and then press Enter. If there is a match for the text you entered, the screen will be updated to the location of the nearest match for the search string. 5 | 6 | The previous search string will be shown in brackets after the search prompt. Hitting Enter without entering any text will perform the previous search. 7 | 8 | The following function keys are available in Search mode: 9 | 10 | ^G (F1) Display this help text 11 | ^C Cancel the current function 12 | ^Y Go to the first line of the file 13 | ^V Go to the last line of the file 14 | 15 | ^P (Up) Recall the previous search/replace string 16 | ^N (Down) Recall the next search/replace string 17 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/resources/org/jline/builtins/nano-search-help.txt: -------------------------------------------------------------------------------- 1 | Search Command Help Text 2 | 3 | Enter the words or characters you would like to search for, and then press Enter. If there is a match for the text you entered, the screen will be updated to the location of the nearest match for the search string. 4 | 5 | The previous search string will be shown in brackets after the search prompt. Hitting Enter without entering any text will perform the previous search. If you have selected text with the mark and then search to replace, only matches in the selected text will be replaced. 6 | 7 | The following function keys are available in Search mode: 8 | 9 | ^G (F1) Display this help text 10 | ^C Cancel the current function 11 | ^Y (F7) (M-\) Move to the first line of the file 12 | ^V (F8) (M-/) Move to the last line of the file 13 | ^R (F14) Replace a string or a regular expression 14 | ^T (F13) Go to line and column number 15 | ^W (M-() (M-9) Move to the beginning of the current paragraph 16 | ^O (M-)) (M-0) Move to the end of the current paragraph 17 | M-C Toggle the case sensitivity of the search 18 | M-B Reverse the direction of the search 19 | M-R Toggle the use of regular expressions 20 | ^P Recall the previous search/replace string 21 | ^N Recall the next search/replace string 22 | ^U (M-J) Justify the entire file 23 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/resources/org/jline/builtins/nano-search-replace-help.txt: -------------------------------------------------------------------------------- 1 | 2 | Search Command Help Text 3 | 4 | Enter the words or characters you would like to search for, and then press Enter. If there is a match for the text you entered, the screen will be updated to the location of the nearest match for the search string. 5 | 6 | The previous search string will be shown in brackets after the search prompt. Hitting Enter without entering any text will perform the previous search. 7 | 8 | The following function keys are available in Search mode: 9 | 10 | ^G (F1) Display this help text 11 | ^C Cancel the current function 12 | M-C Toggle the case sensitivity of the search 13 | M-R Toggle the use of regular expressions 14 | M-B Reverse the direction of the search 15 | ^R Search for a string or a regular expression 16 | ^Y Go to the first line of the file 17 | ^V Go to the last line of the file 18 | 19 | ^P (Up) Recall the previous search/replace string 20 | ^N (Down) Recall the next search/replace string 21 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/resources/org/jline/builtins/nano-write-help.txt: -------------------------------------------------------------------------------- 1 | Write File Help Text 2 | 3 | Type the name that you wish to save the current file as and press Enter to save the file. 4 | 5 | If you have selected text with the mark, you will be prompted to save only the selected portion to a separate file. To reduce the chance of overwriting the current file with just a portion of it, the current filename is not the default in this mode. 6 | 7 | The following function keys are available in Write File mode: 8 | 9 | ^G (F1) Display this help text 10 | ^C Cancel the current function 11 | ^T Go to file browser 12 | M-D Toggle the use of DOS format 13 | M-M Toggle the use of Mac format 14 | M-A Toggle appending 15 | M-P Toggle prepending 16 | M-B Toggle backing up of the original file 17 | 18 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/resources/org/jline/utils/ansi.caps: -------------------------------------------------------------------------------- 1 | # Reconstructed via infocmp from file: /usr/share/terminfo/61/ansi 2 | ansi|ansi/pc-term compatible with color, 3 | am, mc5i, mir, msgr, 4 | colors#8, cols#80, it#8, lines#24, ncv#3, pairs#64, 5 | acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, 6 | bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, clear=\E[H\E[J, 7 | cr=^M, cub=\E[%p1%dD, cub1=\E[D, cud=\E[%p1%dB, cud1=\E[B, 8 | cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, 9 | cuu=\E[%p1%dA, cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P, 10 | dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, 11 | el1=\E[1K, home=\E[H, hpa=\E[%i%p1%dG, ht=\E[I, hts=\EH, 12 | ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L, ind=^J, 13 | indn=\E[%p1%dS, invis=\E[8m, kbs=^H, kcbt=\E[Z, kcub1=\E[D, 14 | kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, khome=\E[H, kich1=\E[L, 15 | mc4=\E[4i, mc5=\E[5i, nel=\r\E[S, op=\E[39;49m, 16 | rep=%p1%c\E[%p2%{1}%-%db, rev=\E[7m, rin=\E[%p1%dT, 17 | rmacs=\E[10m, rmpch=\E[10m, rmso=\E[m, rmul=\E[m, 18 | s0ds=\E(B, s1ds=\E)B, s2ds=\E*B, s3ds=\E+B, 19 | setab=\E[4%p1%dm, setaf=\E[3%p1%dm, 20 | sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, 21 | sgr0=\E[0;10m, smacs=\E[11m, smpch=\E[11m, smso=\E[7m, 22 | smul=\E[4m, tbc=\E[2g, u6=\E[%i%d;%dR, u7=\E[6n, 23 | u8=\E[?%[;0123456789]c, u9=\E[c, vpa=\E[%i%p1%dd, 24 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/resources/org/jline/utils/dumb-color.caps: -------------------------------------------------------------------------------- 1 | dumb-color|80-column dumb tty with 256 coors, 2 | am, 3 | colors#256, cols#80, 4 | bel=^G, cr=^M, cud1=^J, ind=^J, 5 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/resources/org/jline/utils/dumb.caps: -------------------------------------------------------------------------------- 1 | # Reconstructed via infocmp from file: /usr/share/terminfo/64/dumb 2 | dumb|80-column dumb tty, 3 | am, 4 | cols#80, 5 | bel=^G, cr=^M, cud1=^J, ind=^J, 6 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/resources/org/jline/utils/screen-256color.caps: -------------------------------------------------------------------------------- 1 | # Reconstructed via infocmp from file: /usr/share/terminfo/73/screen-256color 2 | screen-256color|GNU Screen with 256 colors, 3 | am, km, mir, msgr, xenl, 4 | colors#256, cols#80, it#8, lines#24, ncv#3, pairs#32767, 5 | acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, 6 | bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l, 7 | clear=\E[H\E[J, cnorm=\E[34h\E[?25h, cr=^M, 8 | csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, 9 | cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, 10 | cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\EM, 11 | cvvis=\E[34l, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, 12 | dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K, enacs=\E(B\E)0, 13 | flash=\Eg, home=\E[H, ht=^I, hts=\EH, ich=\E[%p1%d@, 14 | il=\E[%p1%dL, il1=\E[L, ind=^J, initc@, is2=\E)0, kbs=^H, 15 | kcbt=\E[Z, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, 16 | kdch1=\E[3~, kend=\E[4~, kf1=\EOP, kf10=\E[21~, 17 | kf11=\E[23~, kf12=\E[24~, kf2=\EOQ, kf3=\EOR, kf4=\EOS, 18 | kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, 19 | khome=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~, 20 | nel=\EE, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, 21 | rmcup=\E[?1049l, rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[23m, 22 | rmul=\E[24m, rs2=\Ec\E[?1000l\E[?25h, sc=\E7, 23 | setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m, 24 | setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m, 25 | sgr=\E[0%?%p6%t;1%;%?%p1%t;3%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, 26 | sgr0=\E[m\017, smacs=^N, smcup=\E[?1049h, smir=\E[4h, 27 | smkx=\E[?1h\E=, smso=\E[3m, smul=\E[4m, tbc=\E[3g, 28 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/resources/org/jline/utils/screen.caps: -------------------------------------------------------------------------------- 1 | # Reconstructed via infocmp from file: /usr/share/terminfo/73/screen 2 | screen|VT 100/ANSI X3.64 virtual terminal, 3 | am, km, mir, msgr, xenl, 4 | colors#8, cols#80, it#8, lines#24, ncv#3, pairs#64, 5 | acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, 6 | bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l, 7 | clear=\E[H\E[J, cnorm=\E[34h\E[?25h, cr=^M, 8 | csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, 9 | cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, 10 | cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\EM, 11 | cvvis=\E[34l, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, 12 | dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K, enacs=\E(B\E)0, 13 | flash=\Eg, home=\E[H, ht=^I, hts=\EH, ich=\E[%p1%d@, 14 | il=\E[%p1%dL, il1=\E[L, ind=^J, is2=\E)0, kbs=^H, kcbt=\E[Z, 15 | kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, 16 | kdch1=\E[3~, kend=\E[4~, kf1=\EOP, kf10=\E[21~, 17 | kf11=\E[23~, kf12=\E[24~, kf2=\EOQ, kf3=\EOR, kf4=\EOS, 18 | kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, 19 | khome=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~, 20 | nel=\EE, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, 21 | rmcup=\E[?1049l, rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[23m, 22 | rmul=\E[24m, rs2=\Ec\E[?1000l\E[?25h, sc=\E7, 23 | setab=\E[4%p1%dm, setaf=\E[3%p1%dm, 24 | sgr=\E[0%?%p6%t;1%;%?%p1%t;3%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, 25 | sgr0=\E[m\017, smacs=^N, smcup=\E[?1049h, smir=\E[4h, 26 | smkx=\E[?1h\E=, smso=\E[3m, smul=\E[4m, tbc=\E[3g, 27 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/resources/org/jline/utils/windows-256color.caps: -------------------------------------------------------------------------------- 1 | windows-256color|windows with 256 colors terminal compatibility, 2 | am, mc5i, mir, msgr, 3 | colors#256, cols#80, it#8, lines#24, ncv#3, pairs#64, 4 | bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, clear=\E[H\E[J, 5 | cr=^M, cub=\E[%p1%dD, cub1=\E[D, cud=\E[%p1%dB, cud1=\E[B, 6 | cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, 7 | cuu=\E[%p1%dA, cuu1=\E[A, 8 | il=\E[%p1%dL, il1=\E[L, 9 | dl=\E[%p1%dM, dl1=\E[M, 10 | ech=\E[%p1%dX, 11 | el=\E[K, ed=\E[J, 12 | el1=\E[1K, home=\E[H, hpa=\E[%i%p1%dG, 13 | ind=^J, 14 | invis=\E[8m, kbs=^H, kcbt=\E[Z, 15 | kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, 16 | khome=\E[H, 17 | op=\E[39;49m, 18 | rev=\E[7m, 19 | rmacs=\E[10m, rmpch=\E[10m, rmso=\E[m, rmul=\E[m, 20 | setab=\E[4%p1%dm, setaf=\E[3%p1%dm, 21 | sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, 22 | sgr0=\E[0;10m, 23 | smso=\E[7m, 24 | smul=\E[4m, 25 | kdch1=\E[3~, kich1=\E[2~, kend=\E[4~, knp=\E[6~, kpp=\E[5~, 26 | kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf5=\E[15~, kf6=\E[17~, 27 | kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, 28 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/resources/org/jline/utils/windows-conemu.caps: -------------------------------------------------------------------------------- 1 | windows-conemu|conemu windows terminal, 2 | am, mc5i, mir, msgr, 3 | colors#256, cols#80, it#8, lines#24, ncv#3, pairs#64, 4 | bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, clear=\E[H\E[J, 5 | cr=^M, cub=\E[%p1%dD, cub1=\E[D, cud=\E[%p1%dB, cud1=\E[B, 6 | cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, 7 | cuu=\E[%p1%dA, cuu1=\E[A, 8 | il=\E[%p1%dL, il1=\E[L, 9 | dl=\E[%p1%dM, dl1=\E[M, 10 | ech=\E[%p1%dX, 11 | el=\E[K, ed=\E[J, 12 | el1=\E[1K, home=\E[H, hpa=\E[%i%p1%dG, 13 | ind=^J, 14 | invis=\E[8m, kbs=^H, kcbt=\E[Z, 15 | kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, 16 | khome=\E[H, 17 | op=\E[39;49m, 18 | rev=\E[7m, 19 | rmacs=\E[10m, rmpch=\E[10m, rmso=\E[m, rmul=\E[m, 20 | setab=\E[4%p1%dm, setaf=\E[3%p1%dm, 21 | sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, 22 | sgr0=\E[0;10m, 23 | smso=\E[7m, 24 | smul=\E[4m, 25 | kdch1=\E[3~, kich1=\E[2~, kend=\E[4~, knp=\E[6~, kpp=\E[5~, 26 | kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf5=\E[15~, kf6=\E[17~, 27 | kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, 28 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/resources/org/jline/utils/windows-vtp.caps: -------------------------------------------------------------------------------- 1 | windows-vtp|windows with virtual terminal processing, 2 | am, mc5i, mir, msgr, 3 | colors#256, cols#80, it#8, lines#24, ncv#3, pairs#64, 4 | bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, clear=\E[H\E[J, 5 | cr=^M, cub=\E[%p1%dD, cub1=\E[D, cud=\E[%p1%dB, cud1=\E[B, 6 | cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, 7 | cuu=\E[%p1%dA, cuu1=\E[A, 8 | il=\E[%p1%dL, il1=\E[L, 9 | dl=\E[%p1%dM, dl1=\E[M, 10 | ech=\E[%p1%dX, 11 | el=\E[K, ed=\E[J, 12 | el1=\E[1K, home=\E[H, hpa=\E[%i%p1%dG, 13 | ind=^J, 14 | invis=\E[8m, kbs=^H, kcbt=\E[Z, 15 | kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, 16 | khome=\E[H, 17 | op=\E[39;49m, 18 | rev=\E[7m, 19 | rmacs=\E[10m, rmpch=\E[10m, rmso=\E[m, rmul=\E[m, 20 | setab=\E[4%p1%dm, setaf=\E[3%p1%dm, 21 | sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, 22 | sgr0=\E[0;10m, 23 | smso=\E[7m, 24 | smul=\E[4m, 25 | kdch1=\E[3~, kich1=\E[2~, kend=\E[4~, knp=\E[6~, kpp=\E[5~, 26 | kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf5=\E[15~, kf6=\E[17~, 27 | kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, 28 | smcup=\E[?1049h, rmcup=\E[?1049l, indn=\E[%p1%dS, rin=\E[%p1%dT, 29 | ich=\E[%p1%d@, dch=\E[%p1%dP, ech=\E[%p1%dX, il=\E[%p1%dL, dl=\E[%p1%dM, 30 | sc=\E7, rc=\E8, cnorm=\E[?12l\E[?25h, civis=\E[?25l, cvvis=\E[?12h\E[?25h, 31 | smkx=\E[?1h\E=, rmkx=\E[?1l\E>, u6=\E[%i%d;%dR, u7=\E[6n, 32 | hts=\EH, smacs=\E(0, rmacs=\E(B, 33 | csr=\E[%i%p1%d;%p2%dr, 34 | -------------------------------------------------------------------------------- /xpocket-jline/src/main/resources/org/jline/utils/windows.caps: -------------------------------------------------------------------------------- 1 | windows|windows terminal compatibility, 2 | am, mc5i, mir, msgr, 3 | colors#16, cols#80, it#8, lines#24, ncv#3, pairs#64, 4 | bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, clear=\E[H\E[J, 5 | cr=^M, cub=\E[%p1%dD, cub1=\E[D, cud=\E[%p1%dB, cud1=\E[B, 6 | cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, 7 | cuu=\E[%p1%dA, cuu1=\E[A, 8 | il=\E[%p1%dL, il1=\E[L, 9 | dl=\E[%p1%dM, dl1=\E[M, 10 | ech=\E[%p1%dX, 11 | el=\E[K, ed=\E[J, 12 | el1=\E[1K, home=\E[H, hpa=\E[%i%p1%dG, 13 | ind=^J, 14 | invis=\E[8m, kbs=^H, kcbt=\E[Z, 15 | kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, 16 | khome=\E[H, 17 | op=\E[39;49m, 18 | rev=\E[7m, 19 | rmacs=\E[10m, rmpch=\E[10m, rmso=\E[m, rmul=\E[m, 20 | setab=\E[4%p1%dm, setaf=\E[3%p1%dm, 21 | sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m, 22 | sgr0=\E[0;10m, 23 | smso=\E[7m, 24 | smul=\E[4m, 25 | kdch1=\E[3~, kich1=\E[2~, kend=\E[4~, knp=\E[6~, kpp=\E[5~, 26 | kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf5=\E[15~, kf6=\E[17~, 27 | kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, 28 | -------------------------------------------------------------------------------- /xpocket-plugin-spi/src/main/java/com/perfma/xlab/xpocket/spi/AbstractXPocketAgentPlugin.java: -------------------------------------------------------------------------------- 1 | package com.perfma.xlab.xpocket.spi; 2 | 3 | import com.perfma.xlab.xpocket.spi.process.XPocketProcess; 4 | import java.lang.instrument.Instrumentation; 5 | 6 | /** 7 | * 8 | * @author gongyu43 | * @param message - Error message. 44 | * @param optcode - Option code. 45 | */ 46 | public InvalidTelnetOptionException(final String message, final int optcode) 47 | { 48 | optionCode = optcode; 49 | msg = message; 50 | } 51 | 52 | /** 53 | * Gets the error message of ths exception. 54 | *
55 | * @return the error message.
56 | */
57 | @Override
58 | public String getMessage()
59 | {
60 | return msg + ": " + optionCode;
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/xpocket-runtime/src/main/java/org/apache/commons/net/telnet/TelnetInputListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.commons.net.telnet;
19 |
20 | /**
21 | * Listener interface used for notification that incoming data is
22 | * available to be read.
23 | *
24 | * @see TelnetClient
25 | * @since 3.0
26 | */
27 | public interface TelnetInputListener
28 | {
29 |
30 | /**
31 | * Callback method invoked when new incoming data is available on a
32 | * {@link TelnetClient}'s {@link TelnetClient#getInputStream input stream}.
33 | *
34 | * @see TelnetClient#registerInputListener
35 | */
36 | void telnetInputAvailable();
37 | }
38 |
--------------------------------------------------------------------------------
/xpocket-runtime/src/main/resources/META-INF/services/com.perfma.xlab.xpocket.plugin.command.CommandLoader:
--------------------------------------------------------------------------------
1 | com.perfma.xlab.xpocket.framework.spi.impl.DefaultCommandLoader
--------------------------------------------------------------------------------
/xpocket-runtime/src/main/resources/META-INF/services/com.perfma.xlab.xpocket.plugin.execution.ExecutionEngine:
--------------------------------------------------------------------------------
1 | com.perfma.xlab.xpocket.framework.spi.impl.DefaultExecutionEngine
2 | com.perfma.xlab.xpocket.framework.spi.impl.once.OnceExecutionExecutionEngineImpl
3 |
--------------------------------------------------------------------------------
/xpocket-runtime/src/main/resources/META-INF/services/com.perfma.xlab.xpocket.plugin.loader.PluginLoader:
--------------------------------------------------------------------------------
1 | com.perfma.xlab.xpocket.framework.spi.impl.DefaultPluginLoader
2 | com.perfma.xlab.xpocket.framework.spi.impl.agent.AgentPluginLoaderImpl
--------------------------------------------------------------------------------
/xpocket-runtime/src/main/resources/META-INF/services/com.perfma.xlab.xpocket.plugin.ui.UIEngine:
--------------------------------------------------------------------------------
1 | com.perfma.xlab.xpocket.framework.spi.impl.DefaultUIEngine
2 | com.perfma.xlab.xpocket.framework.spi.impl.once.OnceExecutionUIEngineImpl
3 | com.perfma.xlab.xpocket.framework.spi.impl.agentlauncher.AgentLauncherUIEngineImpl
4 | com.perfma.xlab.xpocket.framework.spi.impl.agent.AgentUIEngineImpl
5 | com.perfma.xlab.xpocket.framework.spi.impl.telnet.TelnetUIEngineImpl
6 | com.perfma.xlab.xpocket.framework.spi.impl.mxbean.MXBeanUIEngineImpl
7 |
--------------------------------------------------------------------------------
/xpocket-scroll/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |