Can i listen the IDE events in my widget?

Is it possible for me to listen the IDE events in my widget? Such as the user changes the theme of the IDE, then i need to change my widget’s theme. Also, i want to do some actions in my widget when the user opens a new Terminal. Is there any listener APIs? Please tall me, thanks a lot.

[original thread by PeimingMo]

[Hanksha]

There is an Event API. For example for the theme you can inject ThemeService and then listen to the theme change events like this this.themeService.onThemeChange((event: ThemeChangeEvent) => console.log(event.newTheme) ). For new terminal event there is maybe something similar, just need to find the right service that provides the event.