Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1367337 - [RFE] Web console terminal should set TERM
[RFE] Web console terminal should set TERM
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console (Show other bugs)
3.3.0
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Jessica Forrester
Yadan Pei
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-08-16 04:49 EDT by Xingxing Xia
Modified: 2017-03-08 13 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Web console does not set a TERM environment variable when the Terminal execs into a pod using the /bin/sh command. Consequence: Certain commands like clear, less, and top do not behave as expected. Fix: The environment variable TERM=xterm is set when /bin/sh is used to connect to the pod. Result: Commands like clear, less, and top behave properly.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-09-27 05:44:26 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1933 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.3 Release Advisory 2016-09-27 09:24:36 EDT

  None (edit)
Description Xingxing Xia 2016-08-16 04:49:52 EDT
Description of problem:
Though https://bugzilla.redhat.com/show_bug.cgi?id=1317778 is fixed, web console still does not set TERM, causing less, top not work well.


Version-Release number of selected component (if applicable):
openshift v3.3.0.19

How reproducible:
Always

Steps to Reproduce:
1. On web console, click Applications --> Pods --> frontend-2-wu20y --> Terminal
2. After entering web terminal's shell, run:
sh-4.2$ top
TERM environment variable not set
sh-4.2$ less /etc/hosts
WARNING: terminal is not full functional
/etc/hosts (press RETURN)

If we press Enter, `less` can show the content of /etc/hosts, though

3. Set TERM manually, run top and less again
sh-4.2$ export TERM=xterm
sh-4.2$ top
sh-4.2$ less /etc/hosts

Actual results:
2. As stated in step inline.
3. top and less work well

Expected results:
2. It is better to automatically set TERM in web terminal like under CLI terminal. CLI terminal results are:
[tester@pc_vm3 oc]$ oc rsh frontend-2-wu20y
sh-4.2$ less /etc/hosts
# Kubernetes-managed hosts file.
127.0.0.1       localhost
::1     localhost ip6-localhost ip6-loopback
<snipped>

sh-4.2$ top

top - 08:37:49 up 1 day,  5:45,  0 users,  load average: 0.18, 0.24, 0.37
Tasks:   7 total,   1 running,   6 sleeping,   0 stopped,   0 zombie
<snipped>


Additional info:
Comment 1 Jessica Forrester 2016-08-16 09:54:42 EDT
The CLI attempts to use whatever your TERM env is set to and then falls back to xterm, see https://github.com/kubernetes/kubernetes/pull/28289/files

We don't know what your TERM env is, so the best we could do is always assume xterm.
Comment 2 Jessica Forrester 2016-08-16 18:36:55 EDT
merging to origin in https://github.com/openshift/origin/pull/10470
Comment 3 Troy Dawson 2016-08-18 15:35:33 EDT
This has been merged into ose and is in OSE v3.3.0.22 or newer.
Comment 5 Xingxing Xia 2016-08-19 02:57:33 EDT
Tested against openshift v3.3.0.22, now in web console terminal, TERM is automatically set to "xterm", `top` and `less` work well like under CLI
Comment 7 errata-xmlrpc 2016-09-27 05:44:26 EDT
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

Note You need to log in before you can comment on or make changes to this bug.