Crypto ssh session.Shell() window height

the server will return —(more)— if the height of shell window too low.
What’s the best way deal with it?
For now, i just set a very large height 100000000

session.RequestPty("xterm", 100000000, 200, modes)

Maybe a shell isn’t what you need. What is the problem you are trying to solve?

For juniper/cisco network devices, the normal way to run commands is login to device through ssh in computer terminal, then type commands manually.
Now we want to do these things automatically.
But it isn’t like run bash commands like “ls”. First, we need to enter network device cli configure mode, then run the commands in the configure mode context. So session.Run(cmd) not works, session.Shell() would help.

Sorry about my english. I am not sure if it is clear about what i am doing.

Yeah, that’s a good point. session.Run won’t do what you want. What happens if you don’t call session.RequestPty before calling Shell?

1 Like

This is often also dealt with on the network device side. That is, on Junos for example show configuration | no-more to not get the paging, or set cli screen-length 0 as the first command after login to disable paging in general. I’m sure there is something similar on IOS that I don’t have it in front of me.

It works well, i am surprised

what’s the difference between call RequestPty with not call?

Request pty allocates a terminal device on the remote end–no terminal device, no need to worry about the size of the virtual terminal as ipthere is none.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.