jsch - send special keys (CTRL-C, CTRL-D, etc.)

人盡茶涼 提交于 2019-12-11 04:02:35

问题


I need to send special keys to a remote terminal, how can I do that with JSCH?

Thanks,

Walter


回答1:


Try sending two bytes: 0x03, 0x04.

Check ASCII table for more.




回答2:


I switched to sshj and use the signal enumeration to send signals, if needed.

Walter




回答3:


You can send a signal like this:

channel.sendSignal("2"); // sends (CTRL+C) signal


来源:https://stackoverflow.com/questions/4167818/jsch-send-special-keys-ctrl-c-ctrl-d-etc

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!