XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Normal
    • Resolution: Won't Do
    • Fix Version/s: 4.x
    • Component/s: Legacy/Tools
    • Labels:
    • Environment:

      This behavior has been observed in xterm on CentOS 7.5 platforms. The test_cqlsh_output.py unit tests (pylib/cqlshlib/test/test_cqlsh_output.py) are a good place to see it in action.

      Description

      Summary: investigate whether we could use a cqlsh-specific terminfo file to prevent use of the set-meta-mode escape sequence in xterm without breaking colors. If it works, see if we can install it in an appropriate place using Python distutils. If yes to both, generate a cqlsh terminfo file and work it into the install process.

      Long detailed explanation:

      In some more recent environments, in Python REPL applications that use the readline module, the set meta mode escape sequence is output before each prompt. This escape sequence has caused problems for some applications, and in our case, some of our cqlsh unit tests (pylib/cqlshlib/test/test_cqlsh_output.py) choke on this output because of the way our tests are designed to detect the cqlsh prompt. This behavior was observed on a CentOS 7.5 platform.

      The set-meta-mode escape sequence normally appears as "[?1034h" in output; it's normally defined as the bytes 1b 5b 3f 31 30 33 34 68.  The exact value of the escape sequence is configurable and may be found on a GNU/Linux platform by running the command:

      tput smm | hexdump

      If this command gives no output, then the set meta mode sequence is not defined on this platform for the terminal in use. Refer to the xterm and terminfo man pages for more information on this sequence.

      There are easier ways to solve this problem for the sake of the unit test, but if time allows, I'd like to look into this to achieve a more consistent output behavior for cqlsh on GNU/Linux platforms.

        Attachments

          Activity

            People

            • Assignee:
              ptbannister Patrick Bannister
              Reporter:
              ptbannister Patrick Bannister
              Authors:
              Patrick Bannister
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: