revolunet / sublimetext-markdown-preview

markdown preview and build plugin for sublime text 2/3
MIT License
2.31k stars 362 forks source link

Allow command line arguments for custom browser #324

Closed hannesfrank closed 6 years ago

hannesfrank commented 8 years ago

Currently it is not possible to use a browser setting like

    "browser": "chromium-browser --incognito"

because (on my linux system) it is resolved to

os.system('"chromium-browser --incognito" /tmp/76.html')

I fixed this for myself by changing the command generation from

cmd = '"%s" %s' % (browser, path)

to

cmd = '%s %s' % (browser, path)

which breaks for executable names with whitespaces like /Applications/Google Chrome Canary.app.

A more generic solution could be to require the user to quote the whitespace like

    "browser": "'/Applications/Google Chrome Canary.app' --incognito"

But this would probably break some user's settings.

For backwards compatibility you could maybe just quote commands that do not contain a " -", but I'm not sure if I miss something.

facelessuser commented 6 years ago

If this is something still desired, please create an issue over at the new supported repo location: https://github.com/facelessuser/MarkdownPreview.