0

I have Linux mint 18, the remote machine have Ubuntu 16.04. When I setup remote session via ssh sometimes it is broken:

enter image description here

As you can see it is restricted by 80x40, but I expect it should take full screen

enter image description here

Sometimes it takes full window, sometimes not.

How to fix that? it should take whole window always.

UPD

I miss major information. I ssh on host then I enter into container:

`kubectl --namespace=$NAMESPACE exec -ti `kubectl --namespace=$NAMESPACE get pods | grep $NAME | cut -f 1 -d ' '` bash`

UPD

$ gnome-terminal --version
GNOME Terminal 3.18.3

A terminal emulator for the GNOME desktop Using VTE version 0.42.5 +GNUTLS

UPD

stty size
0 0
Eugen Konkov
  • 415
  • 7
  • 17
  • 1
    This probably has to do with the environment variable `TERM`, and with the corresponding `terncap` / `terminfo` entry. What is different wen you run into the problem? – Satō Katsura May 22 '17 at 07:41
  • @SatoKatsura, probably you mean `termcap/terminfo` (terMcap) – Romeo Ninov May 22 '17 at 07:44
  • 1
    @RomeoNinov I'm notoriously bad at typing. _shrug_ – Satō Katsura May 22 '17 at 07:48
  • @SatoKatsura: I do not know. I save output from `ENV` and compare them when this problem occur. I will update question with that info. Thanks – Eugen Konkov May 22 '17 at 08:11
  • Try `eval resize`. – dirkt May 22 '17 at 09:23
  • @dirkt: `bash: resize: command not found`, but window resizing helps – Eugen Konkov May 22 '17 at 09:57
  • On Debian, `resize` is part of the `xterm` package, I assume it's the same on Ubuntu. – dirkt May 22 '17 at 11:29
  • 1
    What terminal emulator are you using? Does `stty size` print the correct size before and after running ssh? – Gilles 'SO- stop being evil' May 22 '17 at 23:35
  • You could try my solution from https://unix.stackexchange.com/a/283206/117599 or `busybox`' `resize` instead of the one from the `xterm` package but normally it should not be required on `ssh` since the window resize signal normally works there fine. – phk May 23 '17 at 08:41
  • @Gilles: `stty size -> 0 0` – Eugen Konkov May 23 '17 at 08:57
  • @phk: I have updated question with info about `ssh` – Eugen Konkov May 23 '17 at 08:58
  • Usually problems negotiating window size reflect an authentication problem with the connection (unlikely with ssh), but also a problem with the terminal client (which one, which version are not apparent from the question). For the latter, that would be handled via bug-reporting systems... – Thomas Dickey May 23 '17 at 09:05
  • @ThomasDickey: question updated – Eugen Konkov May 23 '17 at 11:36
  • Most likely `kubectl` is the culprit. You can easily confirm by running `stty size` or `mc` after `ssh`ing but before launching `kubectl`, they should work correctly. I'm not familiar with `kubectl` but I guess it connects to a getty on a serial port or something like that, which by design cannot transfer "meta-data" such as the window size, only the actual bytes to be processed by the terminal emulator. – egmont May 23 '17 at 12:56
  • @egmont: But, as I said before. The `0 0` size returned not always. – Eugen Konkov May 23 '17 at 14:01

0 Answers0