-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
SerializeAsHTML() does not work with xterm-headless - TerminalCore lacks _colorManager #4148
Comments
I'm not surprised this doesn't work, the reason |
Pre-rendered CLI tool output presentation as simple HTML. There may be other ways to accomplish this, but xtermjs is the best for handling problems in this area it seems? |
I don't think we should move xterm.js/addons/xterm-addon-serialize/src/SerializeAddon.ts Lines 546 to 547 in 318abe6
To include a list of colors like this generates: xterm.js/src/browser/ColorManager.ts Lines 30 to 76 in 318abe6
|
If terminal.options.theme is filled in in headless mode, we can use that. |
@silamon I think that's initialized to
But even if it had more of the colors, I don't think it would have |
Maybe the html output of the serialize addon should emit color slots as css classes? This way a theme can be applied to it from a css file defining those colors (except RGB, which can always be derived from CellData). Note - I have not looked at the serialize code, thus idk what it needs the color manager for. |
@jerch i think a common use case would be to put the html into the clipboard and allow pasting into a word doc or something that supports rich text (vscode does this). Going class based wouldn't work as then it's not self contained. |
Well if thats an issue, how about a style/theme argument to Edit: To me it seems pretty obvious not to move the color manager to headless, as there is no notion of colors in headless needed anywhere else. |
This had to get reverted for v5.1 as we can't package implementation from core in the serialize addon yet. |
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:
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.
The text was updated successfully, but these errors were encountered: