本文介绍了如何在telnet客户端上实现命令历史记录? (向上/向下箭头)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台接受telnet连接进行管理的服务器.我错过了命令历史记录,因此我想让telnet会话支持它.我的问题:

I have a server that accept telnet connections for management. I miss the command history so I want to make my telnet session support it. My questions:

1)我必须在服务器端实现该功能,以便服务器将过去的命令发送给客户端,然后客户端可以重新执行吗?

1) Do I have to implement that on the server side, so the server will send the past commands to the client and then the client can re-execute?

2)是否总能在telnet客户端中实现此功能(不与服务器打乱)?

2) Is there anyway to implement this functionality in the telnet client (not messing with the server) ?

如果答案为1),那么我需要知道如何在telnet会话中捕获并发送上下箭头键,而不必按Enter键.

If answer is 1) then I need to know how to capture and send the up and down arrow keys on my telnet session without having to press enter.

推荐答案

这不是服务器问题.只需在您的telnet客户端上使用 rlwrap .它使您无需编程即可使用readline.

This isn't a server issue. Just use rlwrap with your telnet client. It gives you readline with no programming.

$ rlwrap telnet server port

(我实际上使用nc代替telnet,因为它更易于使用并且更强大.)

(I actually use nc instead of telnet since it is easier to use and is more robust.)

这篇关于如何在telnet客户端上实现命令历史记录? (向上/向下箭头)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 14:15