plink on raspberry pi

问题描述:

我想在C++上开发一个使用putty控制树莓派的windows命令行程序。我已经使用腻子应用程序,它工作100%很好。然而,我试图使用plink可执行文件,所以我可以用我的C++程序来控制程序,但是当我尝试连接到Pi时,会得到一串随机字符。 控制台输出如下plink on raspberry pi

C:\Users\user>plink [email protected] 
Using username "pi". 
[email protected]'s password: 
Linux raspberrypi 3.6.11+ #371 PREEMPT Thu Feb 7 16:31:35 GMT 2013 armv6l 

The programs included with the Debian GNU/Linux system are free software; 
the exact distribution terms for each program are described in the 
individual files in /usr/share/doc/*/copyright. 

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent 
permitted by applicable law. 
Last login: Tue May 21 15:59:02 2013 from xxx.xxx.xxx.xxx 
←]0;[email protected]: ~←[01;[email protected]←[00m ←[01;34m~ $←[00m 
←]0;[email protected]: ~←[01;[email protected]←[00m ←[01;34m~ $←[00m 
←]0;[email protected]: ~←[01;[email protected]←[00m ←[01;34m~ $←[00m 

(当i按输入的最后一行再次出现)。

请帮忙吗?

这就是您的shell提示符显示。奇怪的字符是你的shell用来产生彩色终端的控制字符。

Plink没有正确地遵守终端的设置,否则这些控制字符将永远不会被发送。您应该能够保存终端类型设置为'dumb'的腻子会话,并使用-load选项将这些设置加载到plink

+0

嗨,谢谢你的回复。我在connection-> data中添加了哑元到终端类型字符串中。它在你按下回车键时出现的覆盆子pi字符串。但是,当我输入诸如ls之类的基本命令时,控制字符仍然存在。干杯 – joelyboy94