• Sub-task
    • Status: Resolved
    • Normal
    • Resolution: Won't Do
    • 4.1-alpha1, 4.1
    • Legacy/Tools
    • 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.


      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.




            ptbannister Patrick Bannister
            ptbannister Patrick Bannister
            Patrick Bannister
            0 Vote for this issue
            2 Start watching this issue