kubernetes: Initial terminal dimensions for `kubectl exec` are not set correctly
Is this a BUG REPORT or FEATURE REQUEST?: BUG REPORT
Uncomment only one, leave it on its own line:
/kind bug
/kind feature
What happened: kubectl exec -it used to set the terminal dimensions correctly. Now, they’re only set correctly if you resize the terminal. My theory is that this regressed due to underlying architectural changes in docker and how it creates exec processes, but I’m not 100% sure about that.
What you expected to happen: When you kubectl exec -it and inspect $COLUMNS or $LINES, the variables should reflect the current terminal size.
How to reproduce it (as minimally and precisely as possible):
- resize your terminal to something that is not the standard 80x24
- kubectl run --restart Never --image nginx nginx
- kubectl exec -it nginx bash
- echo $COLUMNS
Anything else we need to know?: Forked from #13585.
Environment:
- Kubernetes version (use
kubectl version): commit afc4506 - OS (e.g. from /etc/os-release): Fedora 25
- Kernel (e.g.
uname -a): 4.8.6-300.fc25.x86_64 - Others: docker-1.12.6-6.gitae7d637.fc25.x86_64
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 24 (10 by maintainers)
Commits related to this issue
- Merge pull request #47991 from ncdc/fix-initial-exec-terminal-dimensions Automatic merge from submit-queue Fix initial exec terminal dimensions **What this PR does / why we need it**: Delay attemp... — committed to kubernetes/kubernetes by deleted user 7 years ago
- Merge pull request #51126 from chen-anders/anders/port-47991-to-release-1.6 Automatic merge from submit-queue Cherry Pick on 1.6 - Fix initial exec terminal dimensions (#47991) Cherry-picking #4799... — committed to kubernetes/kubernetes by deleted user 7 years ago
This is still an issue. Is it being looked into?
Stock Ubuntu 18, and at our company we also use a proprietary build of Fedora 27, both with the same results.
With that said - Docker exec reports it fine, but opening say, Vim in a container deployed in Kubernetes vim gets maybe a 4th of the screen.
There was a provided script
kshellin the previous thread:That makes the terminal report everything correctly, but stock kubectl does not.
Hmm, I still got the same result.
Environment:
Kubernetes version (use kubectl version):
OS (e.g. from /etc/os-release): macOS Sierra 10.12.6 Kernel (e.g. uname -a):
(Ran uname -a in nginx pod) Others: Docker for Mac Version 18.05.0-ce-mac66 (24545) edge channel
Also still having the same issue.
What happens if you do a normal
kubectl exec -it, then resize the window? Does it report correctly after the resize?