0

I have having a problem with the CopSSH actually that I installed on Windows7.... When I try to open interactive Python from a SSH session to Windows7, I cannot.

[myuser@myhostname]$/cygdrive/c/Python27/python
# My comment: Nothing happens... It just shows nothing....

But when I use -i with python, it works...

[myuser@myhostname]$/cygdrive/c/Python27/python -i
Python 2.7 (r27:82525, Jul  4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

Similarly, when I try to run a myprogram.exe from a SSH session to Windows7, I cannot see any output where as I see colored output when I run the same program from a RDP session with a command prompt. So, please try to understand that this is not a pexpect, but a CopSSH problem.... I have just updated this question. What follows is my original question....

amulllb
  • 3,036
  • 7
  • 50
  • 87
  • 1
    When you use ssh directly without Python, what behavior do you get? – Amr Jun 28 '12 at 22:01
  • Good point... I just tried it out from SSH and I don't see the colored outputs that I see from a RDP session of a command prompt... Do you why this is happening? Probably the issue is not with the pexpect, but with CopSSH? – amulllb Jun 28 '12 at 22:06

1 Answers1

1

The problem is that you're trying to run an interactive program under Windows, so when it's run non-interactively (not from a terminal or console) it's output gets buffered, and you don't see anything on your end.

Under Unix or Linux this problem is solved through terminal emulation and other tools like expect. However, I don't know if anything can be done for Windows.

If you are the owner of the program on Windows, and if you can modify it, you need to flush the buffer after every output to stdout, this should solve your problem I guess.

Amr
  • 695
  • 4
  • 11
  • 'you need to flush the buffer after every output to stdout' - Where exactly you wish me to do this? On CopSSH? Could you please give an example? Thanks – amulllb Jul 09 '12 at 17:32