Shark
Shark

Reputation: 31

OpenShift - oc rsh hangs when not passing in <cmd> arg

We are running OSE 3.2 and I'm trying to rsh with oc to various pods. I'm using Cygwin. As long as I pass it a command, it works, so I assume it's unable to give me a shell. I've tried setting my TERM environment variable to vt100, xterm, and ansi with no luck. I am able to rsh into pods with oc using the Windows cmd prompt with TERM not set at all, but I really don't like that thing and would prefer to use Cygwin for all functions. I've searched quite a bit for a solution to this, but have come up empty. Thanks much.

Upvotes: 3

Views: 832

Answers (1)

A_Banana
A_Banana

Reputation: 11

Not sure if your problem was resolved, but if there is another person searching for a solution, you need to use winpty. (winpty readme)

Quoting the readme "winpty is a Windows software package providing an interface similar to a Unix pty-master for communicating with Windows console programs. The package consists of a library (libwinpty) and a tool for Cygwin and MSYS for running Windows console programs in a Cygwin/MSYS pty."

Simulated on my laptop:

Before fix:
oc rsh test-pod
(it hangs)

(giving commands to pod works)
oc rsh test-pod ls
bin     config  data    dev     etc     home    lib     proc    root    run     sys     tmp     usr     var

After fix:

(You have to use winpty on every command, so I just use an alias)
alias oc='winpty oc'

(You can enter the pod now)
 oc rsh test-pod
~ $
~ $ ls
bin     config  data    dev     etc     home    lib     proc    root    run     sys     tmp     usr     var

(Giving command to pod still works, even with alias)
oc rsh test-pod ls
bin     config  data    dev     etc     home    lib     proc    root    run     sys     tmp     usr     var

Hope it helps.

Upvotes: 1

Related Questions