In order to have Drush support we will need somehow to implement support for dialogues into the JS and to the module code. Example:

Are you sure you want to download abc module? Y/n.

CommentFileSizeAuthor
#4 terminal-0.4.17-prompt-y-n.zip1.09 KBhkirsman

Comments

snufkin’s picture

Relevant issue on jquery.com: http://plugins.jquery.com/node/8368

greg.1.anderson’s picture

This may be a somewhat extreme solution, but perhaps you should consider using Gate One instead of the jQuery Terminal as your main engine. I haven't tried it, but it sounds promising. See:

http://vimeo.com/24857127

hkirsman’s picture

"Gate One" is crazy application. In a great way! :)

Only drawback would be that it's using Pyhton but if you want to use drush, you must have access to console.

My solution for the y/n problem would be that before sending off the command to php, javascript should ask y or n and update the command. I posted this question on github: https://github.com/jcubic/jquery.terminal/issues/45 No response yet.

Somebody somewhere suggested that -y would be always on.

hkirsman’s picture

StatusFileSize
new1.09 KB

jcubic responded very quickly giving an example:

$('#term').terminal(function(command, term) {
        if (command == 'foo') {
            term.push(function(command) {
                if (command == 'y') {
                    term.echo('execute your command');
                } else if (command != 'n') {
                    return;
                }
                // will exit only for "y" or "n", it will keep asking otherwise
                term.pop();
            }, {
                prompt: 'Are you sure? '
            });
        }
}, {
  prompt: '> '
});

I modified it a little. There's a demo attached to this post.