You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Terminal Providers have been in proposed since April and seem to be working fine. I don't see any open issues relating to them and was wondering what needs to occur to get this planned into a stable release?
Reacted by Riyadh Al Nur, joelcorralesm, Patrick Trant, Matthias Meyer, Shlomi Zeltsinger and JayMcGee
Ian Mckay (@iann0036) I'm mainly waiting for feedback as to my knowledge only Live Share has experimented with them. If you're interested on using the terminal renderer API I'd love to hear more details.
I'm interested in using the terminal renderer for almost the exact same reason as the Live Share team with my extension which transmits/receives terminal data over WebSockets.
Currently, as a workaround, I have a Go app bundled with my extension which I communicate with over IPC for Mac and Linux. Windows is a little more difficult due to the lack of ANSI.
As a final point, things like TreeView in the VSCode namespace (as an example) do indeed have events that are not global (which in my opinion is how they should be).
exportinterfaceTreeView<T>extendsDisposable{/** * Event that is fired when an element is expanded */readonlyonDidExpandElement: Event<TreeViewExpansionEvent<T>>;/** * Event that is fired when an element is collapsed */readonlyonDidCollapseElement: Event<TreeViewExpansionEvent<T>>;
Thoughts Johannes Rieken (@jrieken)? I think we might have gone the original way because the most typical case is that most extensions will want to control only the terminal(s) they have launched. It's not clear to me when this rule should not be followed.
I think we might have gone the original way because the most typical case is that most extensions will want to control only the terminal(s) they have launched. It's not clear to me when this rule should not be followed.
I don't see a strong reason to not follow this rule. The pattern is well established and makes event easy, esp with global things like terminal that can also be created via user-gestures. What is the strong argument here to break consistency?
There are a couple of reasons here to augment the rule.
First is simply performance. The more extensions you have that have to subscribe to global events and handle events they don't necessarily care about, the slower VSCode becomes. I really admire VSCode's desire for speed and am really impressed by it. So the architecture and API design should be done in a way that helps enforce that.
Second is the API surface itself. If all events were to be global, then the number of APIs in a given namespace grows significantly over time. The API surface would end up with a very large namespace with hundreds of APIs and events that would be hard to logically understand.
Some languages, C# as an example, do not allow you to place events in a namespace thereby forcing an architecture where the events are on classes.
There is also an option of having the events at a global scope as well as on an object scope. That would alleviate my performance concerns above.
Final point, if there really is a need for a global event, then perhaps creating logical namespace separations for them in the API surface will with my "large surface area" concern. The "window" namespace is already quite large today.
To clarify the rule, global events only apply to objects that are globally accessible. Terminals are globally accessible but TerminalRenderers are not. So TerminalRenderer events can be private.
Activity
Tyriar commentedon Sep 14, 2018
Ian Mckay (@iann0036) I'm mainly waiting for feedback as to my knowledge only Live Share has experimented with them. If you're interested on using the terminal renderer API I'd love to hear more details.
iann0036 commentedon Sep 15, 2018
Hey Daniel Imms (@Tyriar),
I'm interested in using the terminal renderer for almost the exact same reason as the Live Share team with my extension which transmits/receives terminal data over WebSockets.
Currently, as a workaround, I have a Go app bundled with my extension which I communicate with over IPC for Mac and Linux. Windows is a little more difficult due to the lack of ANSI.
[-]Promote Terminal Providers[/-][+]Promote Terminal Providers to stable[/+][-]Promote Terminal Providers to stable[/-][+]Promote terminal renderer API to stable[/+]4 remaining items
GabeDeBacker commentedon Jan 24, 2019
First, let me comment on the interface above. All the event arguments would need to change to pass the terminal renderer as an argument.
Second, I don't agree with making the terminal events global. I don't believe it makes sense for every consumer to have to do this in there code.
Doesn't seem efficient to broadcast events to multiple subscribers especially when it comes to keystrokes and multple terminals.
I've honestly never seen an approcah like this for events that are specific to an object.
If a subscriber wants to listen to all terminals, then they can already handle
And subscribe to them independently.
As a final point, things like TreeView in the VSCode namespace (as an example) do indeed have events that are not global (which in my opinion is how they should be).
Tyriar commentedon Jan 24, 2019
This is because of https://github.com/Microsoft/vscode/wiki/Extension-API-guidelines#global-events
Thoughts Johannes Rieken (@jrieken)? I think we might have gone the original way because the most typical case is that most extensions will want to control only the terminal(s) they have launched. It's not clear to me when this rule should not be followed.
jrieken commentedon Jan 24, 2019
I don't see a strong reason to not follow this rule. The pattern is well established and makes event easy, esp with global things like terminal that can also be created via user-gestures. What is the strong argument here to break consistency?
GabeDeBacker commentedon Jan 25, 2019
There are a couple of reasons here to augment the rule.
First is simply performance. The more extensions you have that have to subscribe to global events and handle events they don't necessarily care about, the slower VSCode becomes. I really admire VSCode's desire for speed and am really impressed by it. So the architecture and API design should be done in a way that helps enforce that.
Second is the API surface itself. If all events were to be global, then the number of APIs in a given namespace grows significantly over time. The API surface would end up with a very large namespace with hundreds of APIs and events that would be hard to logically understand.
Some languages, C# as an example, do not allow you to place events in a namespace thereby forcing an architecture where the events are on classes.
There is also an option of having the events at a global scope as well as on an object scope. That would alleviate my performance concerns above.
Final point, if there really is a need for a global event, then perhaps creating logical namespace separations for them in the API surface will with my "large surface area" concern. The "window" namespace is already quite large today.
As an example of today. Instead of this:
A much more self discovering mechanism would be:
Tyriar commentedon Jan 30, 2019
To clarify the rule, global events only apply to objects that are globally accessible. Terminals are globally accessible but TerminalRenderers are not. So TerminalRenderer events can be private.
Move terminal renderer API to stable
Tyriar commentedon Mar 22, 2019
Closing in favor of #70978