Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tokenize shell command with quote #258

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sugyan
Copy link

@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

I'm experiencing this issue as well.

@johndbritton
Copy link

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