zeroturnaround / zt-exec

ZeroTurnaround Process Executor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SSH Command, gives "Pseudo-terminal will not be allocated because stdin is not a terminal."

daniel-b2c2 opened this issue · comments

Trying to run an ssh command in zt-exec

new ProcessExecutor()
.command("ssh", "-t", "user@host", "less /var/file")
.redirectInput(System.in)
.redirectOutput(System.out)
.redirectError(System.err)
.execute();

I want the equivalent of running in the terminal ssh -t user@host "less /var/file" which would ssh onto the box, and allow me to interact with less for the given file, when I press q, that exits less, the ssh session should end.

Instead what happens is I get Pseudo-terminal will not be allocated because stdin is not a terminal. and then less just scrolls and doesn't accept input. Is there a workaround for this?

The expectation would be it acts like on the command line, launching less and then continuing once q has been pressed.

This issue is most likely not related to zt-exec. You can check https://stackoverflow.com/questions/7114990/pseudo-terminal-will-not-be-allocated-because-stdin-is-not-a-terminal -- maybe that solves your issue?