Persistent local tty session with java

I am developing a web-shell client with the ability to "complete code" on a tab and ask a question. Does anyone know a way to open a local persistent tty connection, where I can execute several commands with one session, I don’t want to execute Runtime.getRuntime () all the time. Exec ("command"); Any suggestion? Relations

+4
source share
1 answer

Instead of Runtime.getRuntime().exec("command"); make Runtime.getRuntime().exec("/bin/sh"); and hold the Process object. Then you can write the OutputStream commands provided by its getOutputStream() method - I suppose you already get the result by reading its InputStream.

+5
source

All Articles