Execute 'stty raw' command in same terminal? Execute 'stty raw' command in same terminal? unix unix

Execute 'stty raw' command in same terminal?


Since the JVM redirects stdio/stdout/stderr, you might try something like this:

String[] cmd = {"/bin/sh", "-c", "stty raw </dev/tty"};Runtime.getRuntime().exec(cmd);

Note that stty (usually) operates on stdin not stdout.


The stty command performs a set of ioctl operations on standard input. When you call exec, you are forking and execing a new process.

Your choices are either JNI or switching to a GUI-style Java app instead of a console. Heck, you could build your own 100% Java 'console'.