jupyterlite / cockle

In-browser bash-like shell implemented in TypeScript.
BSD 3-Clause "New" or "Revised" License
3 stars 2 forks source link

Add Shell.dispose and new exit command #66

Closed ianthomas23 closed 4 days ago

ianthomas23 commented 4 days ago

This adds dispose functionality to the Shell so that it can be closed and it will clear up after itself. This can be called from outside the Shell, such as by the JupyterLite terminal extension. Also added a new exit command so that the Shell can be closed from within.

This is using the @lumino/disposable and @lumino/signaling packages for consistency with the rest of the Jupyter ecosystem; these packages were already implicit dependencies of cockle and now they are explicit.

It is also possible to connect a callback to the Shell.disposed signal so that when used in the terminal extension it will be possible to exit the shell from within it and this will notify the extension so that the UI can be correctly updated.