Try:
var c = $.terminal.splitCommand(cmd);
if (c.name == "more") {
$.get(c.args[0], function(file) {
term.echo(file);
});
}
It will display whole file all at one, if you want something similar to more command you will need to split the file into pages. Maybe something like this:
var export_data = term.export_view();
$.get(c.args[0], function(file) {
var i = 0;
var lines = file.split('\n');
term.clear().echo(lines.slice(i, i+term.rows()).join('\n'));
term.push($.noop, {
keydown: function(e) {
if (e.which == 32) {
i++;
term.clear().echo(lines.slice(i, i+term.rows()).join('\n'));
} else if (e.which == 27) {
term.pop().import_view(export_data);
}
return false;
}
});
});
If you want to have more then 2 lines displayed then you need to resize the terminal:
var terminal = $('...').terminal(...);
var $win = $(window);
$win.resize(function() {
var height = $win.height();
terminal.innerHeight(height);
}).resize();
terminal.resize();