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
Steps to Reproduce:
1. oc rsh <pod>
2. set TERM manually to enable scrollback (bz#1317778)
3. less /path/to/log
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.
scrollback works properly in less, other command-line tools also work correctly to make troubleshooting easier.
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.
The upstream PR merged. I've opened https://github.com/openshift/origin/pull/9878 to cherry-pick to Origin.
Fixed in 188.8.131.52
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.