Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 98564

Escaping the '[' bracket in a JSON string without there being another ']'

$
0
0

I am trying to map a custom shortcut to VS code that will paste the following string (which clears the console), using the multi_command tool:

"command": "multiCommand.clearConsole",
    "sequence": [
        {
            "command": "type",
            "args": {
              "text": "print("\\033\[2J)
            }
          }
    ]

I have used a double backslash to escape the first backslash, but I need a way of escaping the '[' open bracket.

Does anyone know if it's possible? or an easier way to do it? I just want to clear the console which is hosted on an external device (interacting via PyCOM Console) and interacts via python command line.

Cheers!


Viewing all articles
Browse latest Browse all 98564

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>