1

I am loading raw data from a url into JQuery Terminal...

var terminal = $('#term').terminal(function(command, term) {
    term.pause();
    //set url...
    $.get(url, function(result) {
            term.echo(result, {raw:true}).resume();
    });
}

If the data contains a textarea, it is impossible to edit the text inside because as soon as I click on the textarea, the focus goes back to the prompt. Is there any way to fix this?

jcubic
  • 61,973
  • 54
  • 229
  • 402

1 Answers1

1

You can fix this using this code:

 term.on('mouseup', '.terminal-output textarea, .terminal-output input', function(e) {
     term.disable();
     return false;
 });

jQuery Terminal invoke focus() in mouseup, where it detects if there was no selection.

will add this to next version.

jcubic
  • 61,973
  • 54
  • 229
  • 402