Uploaded image for project: 'Apache Guacamole - Contributions'
  1. Apache Guacamole - Contributions
  2. GUAC-668

Terminal lost after command "reset" with linux terminal

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.0
    • Fix Version/s: 0.9.2
    • Component/s: SSH, Telnet
    • Environment:
      CentOS 6.5 x86_64
    • Sprint:
      DEV 2014-06-20
    • Story Points:
      5

      Description

      A simple "reset" command in a linux terminal (or other commands) will block SSH due to two problems in protocol/ssh/terminal_handlers.c

      1. In function guac_terminal_escape after:

              /* Set Tab (HTS) */
              case 'H':
                  guac_terminal_set_tab(term, term->cursor_col);

      following line is missing:

                  term->char_handler = guac_terminal_echo;

      Without this line the client will stay in escape-sequence-mode and issue an error or malfunction upon further input.

      2. Function guac_terminal_osc does not handle the weird "Pnrrggbb" (set color) and "R" (reset all colors) command used by linux and remains indefinitely in osc-sequence mode if no "ECMA-48 ST" char appears in input. An simple workaround ignoring the command contents would be:

      static int oscignore = 0;

      and at the end of the function:

            else if (oscignore) oscignore--;
            else if (c == 'R') oscignore = 7;
            else if (c == 'P') term->char_handler = guac_terminal_echo;
            else {
                  guac_client_log_info(term->client, "Unhandled OSC sequence: %c", c);
       
                  term->char_handler = guac_terminal_echo;
            }

      Generally it would be better to return to guac_terminal_echo if any sequences are not handled as people often do terrible things like "cat *" and expect the terminal to somehow cope with such nonsense.

        Attachments

          Activity

            People

            Assignee:
            mike.jumper Michael Jumper
            Reporter:
            marwie Martin Wielebinski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: