-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Labels
area/addon/serializegood first issuehelp wantedtype/enhancementFeatures or improvements to existing featuresFeatures or improvements to existing features
Milestone
Description
I tried to use the Terminal from xterm-headless with the xterm-addon-serialize addon. I managed to get it to work after I hacked in a property. See the following code fragment:
import xterm from "xterm-headless";
import { SerializeAddon } from "xterm-addon-serialize";
const term = new xterm.Terminal({
allowProposedApi: true,
});
const ser = new SerializeAddon();
// HACK: Make it work (omit to demonstrate error)
term._core._colorManager = {
colors: {
ansi: {
1: {
css: "blue",
}
}
}
};
term.loadAddon(ser);
term.write("Hello from \x1B[1;3;31mxterm.js\x1B[0m $ ");
term.write("", () => {
// this will throw without the hack
console.log(ser.serializeAsHTML({
includeGlobalBackground: true
}));
});
The ColorManager should get moved to common or this addon package should bundle a copy of it and use it only if there is no _colorManager.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/addon/serializegood first issuehelp wantedtype/enhancementFeatures or improvements to existing featuresFeatures or improvements to existing features