I am using paramiko to connect to a win10 server (client is Linux) and for most parts communication is OK. But when i read the response to a command (via recv()) , i see some strange data. Example: this is the response to "hostname" and it should be just "halfdome-win10" , But what i read back is
'\x1b[5;1Hhalfdome-win10
\x1b[5;2Halfdome-win10
\x1b[5;3Hlfdome-win10
\x1b[5;4Hfdome-win10
\x1b[5;5Hdome-win10
\x1b[5;6Home-win10
\x1b[5;7Hme-win10
\x1b[5;8He-win10
\x1b[5;9H-win10
\x1b[5;10Hwin10
\x1b[5;11Hin10
\x1b[5;12Hn10
\x1b[5;13H10
\x1b[5;14H0
'
if i put this in a variable(say aa) and print it , seems like linux shell can decode and just print the right value.
>>> print cc
>>>
halfdome-win10
is there a right way to get the data from win10 ssh server and decode in a usable form?
I know it has the ansi characters but taking them out does not help and i still see the short echos of the response left.
- i am using updated paramiko
- i have a requirement to use interactive shell
- if i use exec_command instead the stdout reads the expected value (no issue)