Currently it's possible switch to a running terminal if the widget is already opened in the main area. However it's not possible to re-open a closed terminal widget, or shut down a terminal:
Related is that we need to handle an exit command in cockle to shutdown the terminal from within it. Presumably this will need some sort of callback from cockle to terminal.
Problem
Currently it's possible switch to a running terminal if the widget is already opened in the main area. However it's not possible to re-open a closed terminal widget, or shut down a terminal:
jupyterlite-terminal-open-shutdown.webm
Proposed Solution
Implement these functionalities.
Additional context
Tested with the changes from https://github.com/jupyterlite/terminal/pull/11.