I`m developing a web shell client, with tab functionality "code completion" and a have a question. Anyone know a way to open a local tty persistent connection where I can to execute multiple commands with one session, i wont like to exec all time Runtime.getRuntime().exec("command"); Any suggestion? Regards
Instead of Runtime.getRuntime().exec("command");
do Runtime.getRuntime().exec("/bin/sh");
and hold on to the Process
object. Then you can write commands to the OutputStream provided by its getOutputStream()
method - I presume you're already getting the output by reading its InputStream.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With