5
0
mirror of git://git.proxmox.com/git/pve-xtermjs.git synced 2025-03-13 00:58:40 +03:00

implement terminal settings for 3.x

since xtermjs 3.0, the display is not via html anymore, but a canvas
so we cannot use css overrides anymore

this enables us to let the user set a fontsize/family/etc.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2018-04-10 14:01:56 +02:00
parent 7f35422ab5
commit 37445374a3
2 changed files with 15 additions and 1 deletions

View File

@ -70,7 +70,7 @@ Terminal.applyAddon(fit);
createTerminal();
function createTerminal() {
term = new Terminal();
term = new Terminal(getTerminalSettings());
term.on('resize', function (size) {
if (state === states.connected) {

View File

@ -179,3 +179,17 @@ function API2Request(reqOpts) {
throw "unknown method";
}
}
function getTerminalSettings() {
var res = {};
var settings = ['fontSize', 'fontFamily', 'letterSpacing', 'lineHeight'];
if(localStorage) {
settings.forEach(function(setting) {
var val = localStorage.getItem('pve-xterm-' + setting);
if (val !== undefined && val !== null) {
res[setting] = val;
}
});
}
return res;
}