Description of problem: when running "oc rsh", geometry of the console is not passed to the container, so the shell works with default 80×25 geometry which causes scrollback issues in programs like "less" 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. set TERM manually to enable scrollback (bz#1317778) export TERM=xterm 3. less /path/to/log Actual results: file opens up, but when trying to scroll back the screen is corrupted as the actual terminal size is different from what the container thinks. Expected results: scrollback works properly in less, other command-line tools also work correctly to make troubleshooting easier. Additional info: Here's the geometry reported by "stty -a" in the container speed 38400 baud; rows 0; columns 0; line = 0; To work around this issue I did this: 1) find out the geometry of the shell by running "stty -a" before "oc rsh" 2) set the same geometry in the container stty rows 62 columns 224 this made less work properly, however it needs to be done each time and will not catch the changes in terminal window size.
https://github.com/kubernetes/kubernetes/pull/25273
The upstream PR merged. I've opened https://github.com/openshift/origin/pull/9878 to cherry-pick to Origin.
Fixed in 3.3.0.10
Fixed. openshift v3.3.0.14 kubernetes v1.3.0+57fb9ac etcd 2.3.0+git sh-4.2$ stty -a speed 38400 baud; rows 42; columns 114; line = 0;
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