Bug 1317778

Summary: oc rsh does not set TERM
Product: OpenShift Container Platform Reporter: Evgheni Dereveanchin <ederevea>
Component: ocAssignee: Jonh Wendell <jwendell>
Status: CLOSED ERRATA QA Contact: Xingxing Xia <xxia>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.1.0CC: agoldste, aos-bugs, haowang, jokerman, mmccomas, pweil, tdawson, wmeng
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://github.com/openshift/origin/issues/7424
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-27 09:36:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Evgheni Dereveanchin 2016-03-15 08:17:53 UTC
Description of problem:
 when running "oc rsh" the TERM environment variable is not set and the shell works in dumb terminal mode. This causes some applications like "less" to work incorrectly which complicates troubleshooting

Version-Release number of selected component (if applicable):
# oc version
oc v3.1.1.6-21-gcd70c35
kubernetes v1.1.0-origin-1107-g4c8e6f4

How reproducible:
Always

Steps to Reproduce:
1. oc rsh <pod>
2. less /path/to/log

Actual results:
 WARNING: terminal is not fully functional

 scrollback does not work

Expected results:
 less works as expected

Additional info:
 upstream issue https://github.com/openshift/origin/issues/7424

Comment 1 Ben Parees 2016-06-20 19:32:21 UTC
*** Bug 1345731 has been marked as a duplicate of this bug. ***

Comment 2 Andy Goldstein 2016-07-01 20:08:43 UTC
https://github.com/kubernetes/kubernetes/pull/28289

Comment 3 Jonh Wendell 2016-08-01 12:08:55 UTC
The issue has been fixed in origin

Comment 4 Xingxing Xia 2016-08-02 09:18:49 UTC
Checked in latest Origin 
$ oc/openshift version
openshift v1.3.0-alpha.2+b26dd1e
kubernetes v1.3.0+57fb9ac
etcd 2.3.0+git

And in latest puddle:
$ oc/openshift version
openshift v3.3.0.13
kubernetes v1.3.0+57fb9ac
etcd 2.3.0+git

Both in Origin and OCP, bug is fixed:
$ oc rsh database-1-i91xu
sh-4.2$ echo $TERM
xterm-256color
sh-4.2$ top
sh-4.2$ more /etc/bashrc

Both `top` and `more` work well.

** But `oc exec` does not set TERM **
$ oc exec database-1-i91xu -it -- bash
bash-4.2$ echo $TERM                                                                 
dumb
bash-4.2$ top
TERM environment variable not set.

Comment 5 Andy Goldstein 2016-08-02 10:16:17 UTC
We won't be changing `oc exec` for this

Comment 8 errata-xmlrpc 2016-09-27 09:36:20 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1933