Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot switch active unicode version in demo #3442

Closed
Tyriar opened this issue Aug 30, 2021 · 2 comments · Fixed by #3462
Closed

Cannot switch active unicode version in demo #3442

Tyriar opened this issue Aug 30, 2021 · 2 comments · Fixed by #3462
Labels
area/demo good first issue help wanted type/enhancement Features or improvements to existing features
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Aug 30, 2021

Right now when the unicode11 addon is activated the version remains at 6. Instead of adding UI it might be better to set term.unicode.activeVersion = '11' automatically

@Tyriar Tyriar added type/enhancement Features or improvements to existing features help wanted good first issue area/demo labels Aug 30, 2021
@anirudh1713
Copy link
Contributor

anirudh1713 commented Sep 5, 2021

@Tyriar Can I take this on? if so, this will reuqire changing activeVersion in initAddons function and in the change listener for checkbox. is that correct?

xterm.js/demo/client.ts

Lines 370 to 396 in b5df612

function initAddons(term: TerminalType): void {
const fragment = document.createDocumentFragment();
Object.keys(addons).forEach((name: AddonType) => {
const addon = addons[name];
const checkbox = document.createElement('input') as HTMLInputElement;
checkbox.type = 'checkbox';
checkbox.checked = !!addon.instance;
if (!addon.canChange) {
checkbox.disabled = true;
}
addDomListener(checkbox, 'change', () => {
if (checkbox.checked) {
addon.instance = new addon.ctor();
term.loadAddon(addon.instance);
if (name === 'webgl') {
setTimeout(() => {
document.body.appendChild((addon.instance as WebglAddon).textureAtlas);
}, 0);
}
} else {
if (name === 'webgl') {
document.body.removeChild((addon.instance as WebglAddon).textureAtlas);
}
addon.instance!.dispose();
addon.instance = undefined;
}
});

@Tyriar
Copy link
Member Author

Tyriar commented Sep 5, 2021

@anirudh1713 pretty much yeah, thank would be good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/demo good first issue help wanted type/enhancement Features or improvements to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants