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:
parent
7f35422ab5
commit
37445374a3
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user