The problem isn't that sshpass doesn't pass scp's output. The problem is that scp decides that it is running non-interactively, and therefor doesn't produce any output.
I don't know, at this point, what caused scp to decide that.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The immediate cause for scp is an ioctl it does that fails with ENOTTY:
ioctl(1, TIOCGPGRP, 0x7ffc18af0484) = -1 ENOTTY (Inappropriate ioctl for device)
Still investigating why.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm not sure this is worth fixing.
The setup here is this: scp is checking whether it's "foreground" (and thus print the progress) by checking which is the process leader of STDOUT.
When running under sshpass, STDOUT is directed to the parent's STDOUT (typically, the controlling terminal of where sshpass was run). But this is not the controlling terminal for scp itself. This is the PTY that sshpass created to accept the password prompt. This causes the IOCTL to fail, and scp to conclude it is running non-interactively, and not produce the progress output.
A fix would be directing STDOUT and STDERR to the same TTY. This would require sshpass to stick around and continue forwarding output and input from its own streams to the running program.
Feel free to submit such a patch, but this is outside sshpass' intended use.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The problem isn't that sshpass doesn't pass scp's output. The problem is that scp decides that it is running non-interactively, and therefor doesn't produce any output.
I don't know, at this point, what caused scp to decide that.
The immediate cause for scp is an ioctl it does that fails with ENOTTY:
ioctl(1, TIOCGPGRP, 0x7ffc18af0484) = -1 ENOTTY (Inappropriate ioctl for device)
Still investigating why.
I'm not sure this is worth fixing.
The setup here is this: scp is checking whether it's "foreground" (and thus print the progress) by checking which is the process leader of STDOUT.
When running under sshpass, STDOUT is directed to the parent's STDOUT (typically, the controlling terminal of where sshpass was run). But this is not the controlling terminal for scp itself. This is the PTY that sshpass created to accept the password prompt. This causes the IOCTL to fail, and scp to conclude it is running non-interactively, and not produce the progress output.
A fix would be directing STDOUT and STDERR to the same TTY. This would require sshpass to stick around and continue forwarding output and input from its own streams to the running program.
Feel free to submit such a patch, but this is outside sshpass' intended use.