subprocess-tee icon indicating copy to clipboard operation
subprocess-tee copied to clipboard

Does not print partial lines

Open pseyfert-sevensense opened this issue 2 years ago • 0 comments

I thought subprocess-tee would fit in nicely for the following example

from subprocess_tee import run
o = run("ssh remotehost -t sudo cat /super/secret/file"))
# now trim of the password prompt from o

i.e. someone running my python script should see the sudo password prompt from the remote host, and I can capture the cat output in a local variable (i don't want my users to blindly type their sudo passwords, assuming the ssh connection got established, though they still have to trust me that i'm not doing anything nasty with the password). yet, this doesn't work as desired because there is no linefeed after [sudo] password for <user>: and the prompt only becomes printed by subprocess-tee after the user hits return.

pseyfert-sevensense avatar Nov 01 '23 10:11 pseyfert-sevensense