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>
createTerminal();
function createTerminal() {
- term = new Terminal();
+ term = new Terminal(getTerminalSettings());
term.on('resize', function (size) {
if (state === states.connected) {
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;
+}