infprocessmode.java
来自「A framework written in Java for implemen」· Java 代码 · 共 44 行
JAVA
44 行
package gnu.jemacs.buffer;import java.io.*;/** Inferior process (external command) mode. */public class InfProcessMode extends ProcessMode{ Process proc; InputStream out; InputStream err; OutputStream in; public InfProcessMode (Buffer buffer, String command) { this.buffer = buffer; processMark = new Marker(buffer.pointMarker); try { proc = Runtime.getRuntime().exec(command); } catch (Exception ex) { throw new gnu.mapping.WrappedException("cannot run "+command, ex); } in = proc.getOutputStream(); out = proc.getInputStream(); err = proc.getErrorStream(); toInferior = new OutputStreamWriter(in); Thread outThread = new InputStreamHandler(out, this); outThread.setPriority(Thread.currentThread().getPriority() + 1); outThread.start(); Thread errThread = new InputStreamHandler(err, this); errThread.setPriority(Thread.currentThread().getPriority() + 1); errThread.start(); } public static void shellMode (Buffer buffer, String command) { buffer.modes = new InfProcessMode(buffer, command); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?