Is there a way to add hooks in VSCode actions?

Is there a way to add hooks in some particular action of that editor?

For example:

When I start a terminal, executes a script (preferably bashscript like git does).

When I kill a terminal execute another bashscript file (hook).

PS.: I don't want to develop a new extension, I'm looking for something more simple like a configuration of the editor. Public extensions are accepted as answer if does a similar feature but I didn't found out one that does it. Maybe that question can be a suggestion for a new feature.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum