28
28
29
29
public class Demo {
30
30
31
- public static void main (String [] args ) throws IOException , InterruptedException {
32
- // TODO system(false)
33
- try (Terminal terminal = TerminalBuilder .builder ().system (true ).build ()) {
34
- // TODO .systemOutput(ForcedSysOut) ?
31
+ // FTR https://github.com/JetBrains/pty4j/issues/170
35
32
36
- // TODO Fix the (ugly) "echo" which "re-displays" all Fish shell input again
37
- // This does not work well, see https://github.com/JetBrains/pty4j/issues/170;
38
- // Disabling echo does NOT help: terminal.echo(false );
39
- // Do NOT enter raw, it's worse: terminal.enterRawMode();
33
+ public static void main ( String [] args ) throws IOException , InterruptedException {
34
+ try ( Terminal terminal = TerminalBuilder . builder (). build ()) {
35
+ terminal .enterRawMode ( );
36
+ // NB: terminal.echo() true or false makes no difference (because we're in raw mode)
40
37
41
38
int result ;
42
39
// TODO Read from $SHELL (and use cmd.exe on Windows)
@@ -52,7 +49,6 @@ public static void main(String[] args) throws IOException, InterruptedException
52
49
requireNonNull (terminal .output (), "terminal.output" ),
53
50
null ,
54
51
true )) {
55
- // System.out.println("Running, and awaiting exit of: " + String.join(" ", cmd));
56
52
resize (terminal , runner );
57
53
terminal .handle (Terminal .Signal .WINCH , signal -> resize (terminal , runner ));
58
54
result = runner .waitForExit ();
0 commit comments