public String getPrompt() { return shell.getPrompt(); }
void writePromptFlush() { String prompt = shell.getPrompt(); try { StringBuilder sb = new StringBuilder("\r\n"); String p = prompt == null ? "% " : prompt; sb.append(p); CharSequence buffer = term.getBuffer(); if (buffer != null) { sb.append(buffer); } term.append(sb); term.flush(); } catch (IOException e) { // Todo : improve that e.printStackTrace(); } }
/** * Switch to edit. */ Editor edit() { String prompt = shell.getPrompt(); if (prompt != null && prompt.length() > 0) { try { driver.write(prompt); driver.flush(); } catch (IOException e) { // Swallow for now... } } editor.reset(); handler.set(editor); return editor; }
@Override void perform(Editor editor, EditorBuffer buffer) throws IOException { editor.console.driver.cls(); StringBuilder sb = new StringBuilder(); int index = 0; List<String> lines = buffer.getLines(); for (String line : lines) { if (index == 0) { String prompt = editor.console.shell.getPrompt(); sb.append(prompt == null ? "" : prompt); } else { sb.append("\n> "); } sb.append(line); index++; } editor.console.driver.write(sb.toString()); editor.console.driver.flush(); } };
public void end(ShellResponse response) { CRaSHConnector.log.fine("Ended \"" + command + "\""); session.current.compareAndSet(this, null); flush(); String msg = response.getMessage(); if (msg.length() > 0) { session.send("print", msg); } String prompt = session.shell.getPrompt(); session.send("prompt", prompt); session.send("end"); }
log.fine("Sending welcome + prompt"); session.send("print", session.shell.getWelcome()); session.send("prompt", session.shell.getPrompt()); } else if (type.getAsString().equals("execute")) { String command = event.get("command").getAsString();
@Override String execute(Editor editor, EditorBuffer buffer, int[] sequence, boolean flush) throws IOException { editor.lineParser.reset(); buffer.reset(); editor.console.driver.writeCRLF(); String prompt = editor.console.shell.getPrompt(); if (prompt != null) { editor.console.driver.write(prompt); } if (flush) { editor.console.driver.flush(); } return null; } };
for (String line : lines) { if (index == 0) { String prompt = editor.console.shell.getPrompt(); sb.append(prompt == null ? "" : prompt); } else {
out.flush(); } else if (msg instanceof ClientMessage.GetPrompt) { String prompt = shell.getPrompt(); out.writeObject(new ServerMessage.Prompt(prompt)); out.flush();
public void testPromptNoClosure() { Object prompt = session.remove("prompt"); try { String s = shell.getPrompt(); assertNotNull(s); } finally { session.put("prompt", prompt); } } }
String getPrompt() { String prompt = shell.getPrompt(); return prompt == null ? "% " : prompt; } }
public String getPrompt() { return shell.getPrompt(); }
public String getPrompt() { return shell.getPrompt(); }
public String getPrompt() { return shell.getPrompt(); }
void writePromptFlush() { String prompt = shell.getPrompt(); try { StringBuilder sb = new StringBuilder("\r\n"); String p = prompt == null ? "% " : prompt; sb.append(p); CharSequence buffer = term.getBuffer(); if (buffer != null) { sb.append(buffer); } term.append(sb); term.flush(); } catch (IOException e) { // Todo : improve that e.printStackTrace(); } }
void writePromptFlush() { String prompt = shell.getPrompt(); try { StringBuilder sb = new StringBuilder("\r\n"); String p = prompt == null ? "% " : prompt; sb.append(p); CharSequence buffer = term.getBuffer(); if (buffer != null) { sb.append(buffer); } term.provide(Text.create(sb)); term.flush(); } catch (IOException e) { // Todo : improve that e.printStackTrace(); } }
public void end(ShellResponse response) { CRaSHConnector.log.fine("Ended \"" + command + "\""); session.current.compareAndSet(this, null); flush(); String msg = response.getMessage(); if (msg.length() > 0) { session.send("print", msg); } String prompt = session.shell.getPrompt(); session.send("prompt", prompt); session.send("end"); }
@Override String execute(Editor editor, EditorBuffer buffer, int[] sequence, boolean flush) throws IOException { editor.lineParser.reset(); buffer.reset(); editor.console.driver.writeCRLF(); String prompt = editor.console.shell.getPrompt(); if (prompt != null) { editor.console.driver.write(prompt); } if (flush) { editor.console.driver.flush(); } return null; } };
@Override String execute(Editor editor, EditorBuffer buffer, int[] sequence, boolean flush) throws IOException { editor.lineParser.reset(); buffer.reset(); editor.console.driver.writeCRLF(); String prompt = editor.console.shell.getPrompt(); if (prompt != null) { editor.console.driver.write(prompt); } if (flush) { editor.console.driver.flush(); } return null; } };