Karaf
  1. Karaf
  2. KARAF-536

Backspace no longer works in Putty after using 'connect' command to connect to other instance, and commands are printed in only 2 columns.

    Details

      Description

      When connecting to an instance using putty, and then connect to another instance using the 'connect' command:

      • the backspace button no longer functions
      • the commands shown after pressing TAB and choosing 'y' are shown in only 2 columns while my screen is much wider, and the instance I originally connected to does show 5 columns.

        Activity

        Hide
        Christian Schneider added a comment -

        According to JB ssh can not transmit terminal informations while running so it seems what I have implemented is as much as we can achieve.

        Show
        Christian Schneider added a comment - According to JB ssh can not transmit terminal informations while running so it seems what I have implemented is as much as we can achieve.
        Hide
        Christian Schneider added a comment -

        Hi Jamie,

        I already committed the part I have done for all branches. So when you connect to another karaf instance the terminal size is set correctly. The
        only problem is that it is not changed when the terminal window changes its size. To also make this work we would need some machanism to transfer the change in terminal size to the ssh server. No idea if this is possible.

        So the question is if we should closse this and live with the fact that changes in size are not reflected? Perhaps Guillaume knows if this is possible.

        Christian

        Show
        Christian Schneider added a comment - Hi Jamie, I already committed the part I have done for all branches. So when you connect to another karaf instance the terminal size is set correctly. The only problem is that it is not changed when the terminal window changes its size. To also make this work we would need some machanism to transfer the change in terminal size to the ssh server. No idea if this is possible. So the question is if we should closse this and live with the fact that changes in size are not reflected? Perhaps Guillaume knows if this is possible. Christian
        Hide
        Jamie goodyear added a comment -

        Hi Christian,

        Could you give us an update on your findings? Do you think you'll have a patch before the 2.2.8 RC? No worries if its not, just updating JIRA.

        Cheers,
        Jamie

        Show
        Jamie goodyear added a comment - Hi Christian, Could you give us an update on your findings? Do you think you'll have a patch before the 2.2.8 RC? No worries if its not, just updating JIRA. Cheers, Jamie
        Hide
        Christian Schneider added a comment -

        The setter on ChannelSession works. It does not react on terminal size changes after the connect but at least you have the terminal size from the moment of the connect.

        Show
        Christian Schneider added a comment - The setter on ChannelSession works. It does not react on terminal size changes after the connect but at least you have the terminal size from the moment of the connect.
        Hide
        Christian Schneider added a comment - - edited

        I debugged the code to find where the terminal size 80 comes from. I think it is in org.apache.sshd.client.channel.ChannelShell. There the terminal columns are set to 80.
        Then it checks if we are on unix and uses stty to get the real size. On windows it does not change the column number. There are setters on the ChannelShell for columns .. will try these.

        Show
        Christian Schneider added a comment - - edited I debugged the code to find where the terminal size 80 comes from. I think it is in org.apache.sshd.client.channel.ChannelShell. There the terminal columns are set to 80. Then it checks if we are on unix and uses stty to get the real size. On windows it does not change the column number. There are setters on the ChannelShell for columns .. will try these.
        Hide
        Christian Schneider added a comment -

        I was able to reproduce the term width issue with a simpler test. You can simply start karaf and log into your own instance and the issue will already be present.

        Start karaf.bat
        echo ($.jline.terminal getWidth)
        205
        ssh:ssh -p 8101 localhost
        echo ($.jline.terminal getWidth)
        80

        Show
        Christian Schneider added a comment - I was able to reproduce the term width issue with a simpler test. You can simply start karaf and log into your own instance and the issue will already be present. Start karaf.bat echo ($.jline.terminal getWidth) 205 ssh:ssh -p 8101 localhost echo ($.jline.terminal getWidth) 80
        Hide
        Christian Schneider added a comment - - edited

        Tested with Karaf 3 snapshot. Backspace works but tab shows commands only in 3 columns. So partly this also seems to be relevant to Karaf 3 too.
        I tested "echo ($.jline.terminal getWidth)" on the first and on the second karaf. On the first it prints the correct terminal size. On the second it always prints 80.

        Show
        Christian Schneider added a comment - - edited Tested with Karaf 3 snapshot. Backspace works but tab shows commands only in 3 columns. So partly this also seems to be relevant to Karaf 3 too. I tested "echo ($.jline.terminal getWidth)" on the first and on the second karaf. On the first it prints the correct terminal size. On the second it always prints 80.
        Hide
        Jamie goodyear added a comment -

        Bumping to 2.2.7.

        Show
        Jamie goodyear added a comment - Bumping to 2.2.7.
        Hide
        Jamie goodyear added a comment -

        Bumping to 2.2.6.

        Show
        Jamie goodyear added a comment - Bumping to 2.2.6.
        Hide
        Jamie goodyear added a comment -

        Bumping out to 2.2.4.

        Show
        Jamie goodyear added a comment - Bumping out to 2.2.4.
        Hide
        Jamie goodyear added a comment -

        Bumping up fix version.

        Show
        Jamie goodyear added a comment - Bumping up fix version.
        Hide
        Jamie goodyear added a comment -

        Bumping up fix version.

        Show
        Jamie goodyear added a comment - Bumping up fix version.
        Hide
        Achim Nierbeck added a comment -

        verified it, also when starting the initial karaf instance by double klicking on the karaf.bat and connecting from that terminal the "list all commands" does the output only in 2 columns and not in 5, but the backspace works. So it looks more like a bad combination of putty and the admin:connect command.

        Putty version: Release 0.60

        Show
        Achim Nierbeck added a comment - verified it, also when starting the initial karaf instance by double klicking on the karaf.bat and connecting from that terminal the "list all commands" does the output only in 2 columns and not in 5, but the backspace works. So it looks more like a bad combination of putty and the admin:connect command. Putty version: Release 0.60
        Hide
        Jamie goodyear added a comment -

        I think we need to look into org.apache.sshd sshd-core 0.5.0 to see if that package or our use of it is leading to the problem.

        Have you tried any other SSH clients on your platform? (I'm assuming windows) Do they also have the same issue? Which version of PuTTY as well, we've seen other issues in the past with this client.

        Show
        Jamie goodyear added a comment - I think we need to look into org.apache.sshd sshd-core 0.5.0 to see if that package or our use of it is leading to the problem. Have you tried any other SSH clients on your platform? (I'm assuming windows) Do they also have the same issue? Which version of PuTTY as well, we've seen other issues in the past with this client.

          People

          • Assignee:
            Christian Schneider
            Reporter:
            Geert Schuring
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development