This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Disabling VT100 Commands in SDK14

I'm in the process of updating from SDK13 to SDK14. In the new CLI, there are a lot of NRF_CLI_VT100_CMD's that are used which weren't there before. If someone is using a plain serial port terminal application with no terminal emulation (like CoolTerm for example which is a popular option on macOS), having these VT100 commands adds a lot of garbage ASCII characters in the logging/CLI output. I couldn't find a way to disable these VT100 commands (all defined in nrf_cli_vt100.h) even though there's a way to disable VT100 colors.

  • Has anybody else ran into this problem?
  • It there any way to disable these VT100 commands?
  • Hi

    In case you are using Logger module with CLI you will not avoid VT100 commands. There are needed for commands like: clear screen, saving cursor position, restoring cursor position and so on.

    If you are not using CLI as Logger backend you can try integrate CLI from SDK13. I think I saw a user who did it without bigger problem.

    Another alternative if you are using MAC is to try application: iTerm2

    screen /dev/tty.usbmodemXXXX 115200
    // where XXXX refers to devkit serial port
    

    We were able to configure it to interpret VT100 commands correctly: image description image description

  • Thanks Jacub.

    Integrating CLI from SDK13 is not very straight forward and would involve touching a lot of files to make them work with the old logging and CLI modules.

    Supporting VT100 commands by default without a way to disable it is an unwelcome change in SDK14. If we are using the CLI and the logging modules to interface with units in setups that we have little control over like on a factory floor, this makes our life very hard.

  • With small code modification it is possible to disable VT100 commands in new CLI but in such case text displayed on the screen will be confusing.

    I am refering to situation when you are typing a command and a log pops up. Current implementation looks more less as follows:

    1. save currently entered command
    2. erase: console name and command (VT100 command: clear + possible cursor manipulation)
    3. print log
    4. go to new line (if needed)
    5. print console name and saved command

    Without step 2, one might think that command was executed before printing log.

    Another case where VT100 commands are used in SDK14 is when user is editing mutliline command. It is used to manipulate cursor so also special buttons are affected like 'home', 'end', 'backspace' (also in SDK13) ...

    Increased VT100 commands utilization I would rather name as an extension of functionality not as an unwelcome change. If you will use CLI from SDK14 in the same way as CLI from SDK13 you shall be able to avoid VT100 commands. But in such case you will not have CLI as logger backend.

    If you have some ideas how logs and multiline edidion can be combined with CLI without VT100 commands please let me know. I could try to implement it in SDK.

Related