Support changing terminal background color
This commit is contained in:
@@ -116,12 +116,20 @@ jQuery(function($){
|
||||
return {'cols': cols, 'rows': rows};
|
||||
}
|
||||
|
||||
|
||||
function resize_terminal(term) {
|
||||
var geometry = current_geometry(term);
|
||||
term.on_resize(geometry.cols, geometry.rows);
|
||||
}
|
||||
|
||||
|
||||
function set_backgound_color(term, color) {
|
||||
term.setOption('theme', {
|
||||
background: color
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function format_geometry(cols, rows) {
|
||||
return JSON.stringify({'cols': cols, 'rows': rows});
|
||||
}
|
||||
@@ -332,6 +340,10 @@ jQuery(function($){
|
||||
}
|
||||
};
|
||||
|
||||
wssh.set_bgcolor = function(color) {
|
||||
set_backgound_color(term, color);
|
||||
};
|
||||
|
||||
term.on_resize = function(cols, rows) {
|
||||
if (cols !== this.cols || rows !== this.rows) {
|
||||
console.log('Resizing terminal to geometry: ' + format_geometry(cols, rows));
|
||||
|
||||
Reference in New Issue
Block a user