0

I am using Jquery Terminal, and am trying to hide the prompt until greetings is typed. Currently I am using setTimeout to delay greeting but later will stimulate user typing. Using set_prompt() I am able to hide text in prompt but cursor still keeps in blinking. Here is my js code

$('#term_demo').terminal({
echo: function(arg1) {
    this.echo(arg1);
},
rpc: 'some_file.php',
calc: {
    add: function(a, b) {
        this.echo(a+b);
    },
    sub: function(a, b) {
        this.echo(a-b);
    }
}
}, { prompt: '>', greeting: false, onInit : function(){
var that  = this;
this.set_prompt("");
setTimeout(function(){
    that.echo("gugrgv");
},3000);

} });
Rishabh Jain
  • 526
  • 1
  • 10
  • 26

1 Answers1

1

You can use pause to hide both prompt and disable blinking and if you will want to have animation using prompt you can use pause(true). It will pause, but not hide the prompt so use:

var prompt = term.get_prompt();
term.set_prompt('').pause(true)
setTimeout(function(){
    that.echo("gugrgv").set_prompt(prompt).resume();
}, 3000);

And if you want simulate typing you can check typing example

jcubic
  • 61,973
  • 54
  • 229
  • 402