Skip to content

tokenize shell command with quote#258

Open
sugyan wants to merge 1 commit intojigish:masterfrom
sugyan:master
Open

tokenize shell command with quote#258
sugyan wants to merge 1 commit intojigish:masterfrom
sugyan:master

Conversation

@sugyan
Copy link
Copy Markdown

@sugyan sugyan commented Mar 1, 2013

I wrote .slate.js

var launch_and_focus = function (target) {
    return function (win) {
        var apps = [];
        S.eachApp(function (app) { apps.push(app.name()); });
        if (! _.find(apps, function (name) { return name === target; })) {
            win.doOperation(
                S.operation('shell', {
                    command: "/usr/bin/open -a '" + target + "'",
                    waithFoeExit: true
                })
            );
        }
        win.doOperation(S.operation('focus', { app: target }));
    };
};
S.bind('i:ctrl,cmd', launch_and_focus('iTerm'));
S.bind('g:ctrl,cmd', launch_and_focus('Google Chrome'));

if app exists, focus at app. if app doesn't exist, launch app by "open" command.
but this doesn't work on 'Google Chrome'. shell command was parsed as
/usr/bin/open, -a, 'Google and Chrome' ...
shell command should be tokenized with quote.

@johndbritton
Copy link
Copy Markdown

I'm experiencing this issue as well.

@johndbritton
Copy link
Copy Markdown

I've got this in my .slate config:
bind c:${slate_keys} shell path:~/ '/usr/bin/open -a /Applications/Google Chrome.app'

I've also tried this:
bind c:${slate_keys} shell path:~/ '/usr/bin/open -a /Applications/Google\ Chrome.app'

djl added a commit to djl/slate that referenced this pull request Oct 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants