Visual Studio Code launch.json runtimeArgs with double quotes in the argument

Viewed 4302

I'm running Visual Studio Code with the 'Debugger for Chrome' extension to debug some javascript. However, I want to run an out of process pepper plugin while debugging.

Outside of Visual Studio Code we do this by passing the following command line flags to chrome.exe (among others):

--register-pepper-plugins="path_to_plugin";mime_type

Note: requires double quotes

To pass command line arguments to Chrome via Visual Studio Code I set up a launch.json with the following addition:

"runtimeArgs" : ["--register-pepper-plugins=\"path_to_plugin\";mime_type"]

I can see using ProcessExplorer that my runtimeArgs are being passed to Chrome, but with the escape character \ intact, so what chrome actually receives is:

--register-pepper-plugins=\"path_to_plugin\";mime_type

rather than

--register-pepper-plugins="path_to_plugin";mime_type

If I remove the escape character, I only get

--register_pepper_plugins=

because the second double quote matches the first.

Am I doing something blindingly obvious wrong here?

2 Answers

Escaping quotes in arguments is a historical thing in vscode - see an explanation post near the bottom of their issue discussion.

Meanwhile, you can somewhat work around it if you use this (launch.json) configuration setting:

"console": "internalConsole",

as of today, vscode doesn't escape anything if running commands through that internal console. "externalTerminal" value also works. If using internal console, consider "internalConsoleOptions" choice to see what's happening in there.

Related