Goal
Session and pty decoupled.
Some plugins need more control about Session instances in main process. It would be required, for example, if a plugin want to launch the pty in another host (like #2978) or intercept pty stream to duplicate/record/stream/log it.
Interception can already be done with a middleware in renderer process, but having a Session without a pty can't.
Proposal
I would suggest to add a new API entry: decorateSessionClass(Session). A plugin can expose this function that would return a new class that inherit from the (kind of) Session class received in parameter.
If multiple plugins declare this hook, we would finally get a class that have been multiple times inherited. It can lead to some conflicts but this is already the case for other decorate functions.
Goal
Sessionandptydecoupled.Some plugins need more control about Session instances in main process. It would be required, for example, if a plugin want to launch the
ptyin another host (like #2978) or intercept pty stream to duplicate/record/stream/log it.Interception can already be done with a middleware in renderer process, but having a Session without a
ptycan't.Proposal
I would suggest to add a new API entry:
decorateSessionClass(Session). A plugin can expose this function that would return a new class that inherit from the (kind of) Session class received in parameter.If multiple plugins declare this hook, we would finally get a class that have been multiple times inherited. It can lead to some conflicts but this is already the case for other decorate functions.