I have a command XYZ
sent over a channel using the sendall()
channel = ssh.invoke_shell()
channel.sendall('XYZ
')
response = channel.recv(2000)
I should have the entire output right there, but then I notice that in the last line of the output that I do receive, there is a --more--
at the end. Like the one that you get when you use the less
command.
As a result, the channel is still waiting for more output because the buffer is not empty (more output is expected) and the command is expecting me to press SPACE to display more of the output.
The channel just waits forever.
How do I get the entire output in one go? I do not want that --more--
.
Increasing the buffer size makes no difference.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…