Please help with resize

  • Hi,
    I have an urgent problem, the resizing of the screen does not inform the server that the size has changed. when the screen is resized no information is being sent to the server, I chcked it.

    what string should be sent to the server so server knows that the screen is resized, I found this on the internet:
    ESC [ 8 ; Ph ; Pw t
    but it does not seem to do anything. Only when I type "resize" on the prompt the server will resize itself.

    I need this because my users use vi and if they change the size of the screen , the server still thinks it's 80 by 24 and so it messes up the output.

    Please, please, if you could even point me to some direction to find a solution, I will truely appreciate it.


    • depending on whether you use Telnet or SSH
      this is handled by the lowlevel protocol.

      Telnet - via NAWS telnet option
      SSH - have to check.

      It is not implemented for both of those currently.

      I will try to whip up a patch for Telnet and check how it is done for SSH.

      Ciao, Marcus

    • I truely appreciate that, my users are using this for SSH, and it's an urgent issue.

      Many thanks in advance.


      • I have uploaded test jar for you

        it uses this diff against the current sources:

        Note that the "Terminal.resize" property is now "screen", otherwise just the font will be resized.

        Ciao, Marcus

    • Hi Marcus,

      Thank you very much for taking the trouble. I'm trying to adapt it to Jsch, but still have not had any luck, I'm using JTA with JSch, are you familiar with JSch? and if so would you be able to point me to some direction on how to write a method like:
      public void setWindowSize(int r, int c){ }

      that would send the resize message to the server. I appreciate your time.

      • i am not familar with JSch and its design is very different I guess.

        The idea behind the patch is that on resize of the screen you sent

        - for Telnet a "NAWS" negotiation
        - for SSH a SSH_CMSG_WINDOW_SIZE packet.

        Ciao, Marcus