从 php 网页运行 Expect 时公布自定义终端大小
我正在使用 php 执行一个期望脚本,该脚本通过 telnet 到远程服务器。 问题是 我遇到很多来自服务器的“更多”提示,这些提示通常在屏幕已满时出现。 有没有办法通过宣传我的屏幕尺寸很大来欺骗服务器?
请注意,我没有从 cli 运行 php,因此不确定如何在此处使用 stty。
I am using php to execute an expect script which telnets to a remote server.
The problem is
I am encountering a lot of 'more' prompts from the server that usually occurs when the screen is full.
Is there a way to fool the server by advertising my screen size to be large?
Please note that I am not running php from cli, hence not sure how stty can be used here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最近我有同样的需求。经过大量谷歌搜索、阅读 telnet 来源和期望手册页后,我找到了解决方案。您可以将所需的伪终端 (pty) 大小设置为 10000x200,如下所示:
Recently I had the same need. After a lot of googling, reading a sources of telnet and expect manual page I have found a solution. You can set your desired pseudo-terminal (pty) size to 10000x200 for example like this:
telnet 服务器使用 Telnet 窗口大小选项 RFC 1073 计算窗口大小。它通常被称为 NAWS,代表 Negotiate About Window Size。您使用的是什么 telnet 客户端,您是否能够覆盖它发送的 NAWS 消息?
The telnet server works out the window size using RFC 1073, the Telnet window size option. It's often called NAWS, which stands for Negotiate About Window Size. What telnet client are you using, and are you able to override the NAWS message it sends?