How do I force jquery terminal to remain the same

2019-07-24 12:24发布

问题:

I am using Jquery terminal and it seems pretty cool. I've been looking around for several hours now, and I can't find a way to get the console to remain stationary when text is inputted.

Instead, the console increases in size for every line of input that I enter. Does anyone know how to keep a constant size for the terminal, is it a setting I missed or something? I want something like this.

回答1:

Add a height option:

JS

$('#terminal').terminal(function (command, term) {
    if (command == 'test') {
        term.echo("you just typed 'test'");
    } else {
        term.echo('unknown command');
    }
}, {
    prompt: '>',
    name: 'test',
    height: 200
});

Demo: http://jsfiddle.net/11o3spLd/