Fix client in batch mode (-b)
@@ -191,6 +191,7 @@ public class Main {
if (config.getCommand().length() > 0) {
ChannelExec channel = session.createExecChannel(config.getCommand() + "\n");
channel.setIn(new ByteArrayInputStream(new byte[0]));
+ if (!config.isBatch()) {
new Thread() {
public void run() {
while (true) {
@@ -207,6 +208,7 @@ public class Main {
}
}
}.start();
+ }
channel.setAgentForwarding(true);
NoCloseOutputStream output = new NoCloseOutputStream(terminal.output());
channel.setOut(output);
