-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Support for window options #2393
Conversation
@Tyriar This turns out to be a bigger construction site than initially thought, parts of the features xterm offers under this sequence are deeply linked to X11 stuff (thus for xterm.js use cases prolly platform display/window manager dependent). I think we should not try to implement things here on our own, maybe just forward it via some API so integrators can fill the gaps they want to support. Will see if I can come up with an easy to intercept interface. |
@Tyriar Reviewed the sequence again and indeed - it makes not much sense to build a sub API for all those platform dependent things, instead we should only deal with reports we can directly handle and leave all other things to a custom Things we can directly support/handle from within xterm.js:
Things left to integrators:
As you can see there is not much left to implement for us atm. To help integrators to get the other things done, we might need to implement some helpers on public API (like directly exposing some container metrics and such), but we can do that as it gets requested. Sidenote: I added icon label and window title handling on our side. Imho we can provide these features with a tiny implementation as we always know the propagated values from the OSC calls. There is a minor downside to this - if an implementation does not adopt the Edit: I still think we will need some security settings here to not earn a CVE, maybe we can just adopt the xterm's security settings as ctor options. |
@Tyriar Updated the PR with implementations for params we actually can handle without further knowledge about the embedding env. About security: Put all handling behind an option About DECCOLM: I also put DECCOLM handling behind Need some help with the first line here: Lines 2084 to 2098 in da3ae79
What is the supposed way to get a hold of the pixel dimensions? Also the values I return under 14/16 might not be right ones. Please have a look at this. |
@Tyriar Changed the windowOptions into a const enum for internal usage (number). The external API turns it into a Imho a new settings impl should support external type --> internal type conversions (my stub does not yet). |
@Tyriar The const enum indirection is quite ugly and we dont need the speed benefit, thus I removed it. |
Ready for the next review 😄 Edit: Should the windowOptions get a dedicated guide? Imho the security aspects and the impl of several commands might be abit tricky to comprehend without. (Edit: covered by xtermjs/xtermjs.org#116) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there 😃
PR for support of window option reports and manipulations (CSI ... t).
To get this working we have several things to fiddle out:
_private._private
access. Resizing itself would need something like the fit addon in the codebase.options.allowTitleOps
,options.allowGeometryOps
and such so ppl/integrators are still in control over those featuresThe early stub only contains a hacked version of grid size report and resize working with the demo.
Closes #1762.