提交 ee27b252 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 988978ad
...@@ -326,7 +326,12 @@ public class Shell extends Tool { ...@@ -326,7 +326,12 @@ public class Shell extends Tool {
println("Connected"); println("Connected");
} }
private void print(String s) { /**
* Print the string without newline, and flush.
*
* @param s the string to print
*/
protected void print(String s) {
out.print(s); out.print(s);
out.flush(); out.flush();
} }
...@@ -347,6 +352,7 @@ public class Shell extends Tool { ...@@ -347,6 +352,7 @@ public class Shell extends Tool {
} catch (Exception e) { } catch (Exception e) {
// ignore, use the default solution // ignore, use the default solution
} }
/** /**
* This thread hides the password by repeatedly printing * This thread hides the password by repeatedly printing
* backspace, backspace, >, <. * backspace, backspace, >, <.
...@@ -355,7 +361,7 @@ public class Shell extends Tool { ...@@ -355,7 +361,7 @@ public class Shell extends Tool {
volatile boolean stop; volatile boolean stop;
public void run() { public void run() {
while (!stop) { while (!stop) {
out.print("\b\b><"); print("\b\b><");
try { try {
Thread.sleep(10); Thread.sleep(10);
} catch (InterruptedException e) { } catch (InterruptedException e) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论