(function () {
'use strict';
const KEY = 'mobux:renderer';
const VALID = new Set(['xterm', 'sterk']);
const DEFAULT = 'xterm';
const select = document.getElementById('rendererSelect');
const status = document.getElementById('rendererStatus');
if (!select) return;
function showStatus(text) {
if (!status) return;
status.textContent = text;
status.hidden = false;
clearTimeout(showStatus._t);
showStatus._t = setTimeout(() => {
status.hidden = true;
}, 3000);
}
function read() {
try {
const v = localStorage.getItem(KEY);
if (VALID.has(v)) return v;
} catch (_) {}
return DEFAULT;
}
select.value = read();
select.addEventListener('change', () => {
const v = VALID.has(select.value) ? select.value : DEFAULT;
try { localStorage.setItem(KEY, v); } catch (_) {}
showStatus(`Saved. Reload any open terminal tab to switch to ${v}.`);
});
})();