FullStackedrunning-projects.mdEdit

Running projects

Every project you run gets a context: its own root, environment, streams and window. The shell is context 0. These commands show and control the contexts of your projects folder.

ps

text
$ ps
ID  PARENT  WINDOW  DIRECTORY
0*  -       yes     /
2   0       yes     /demo
3   2       no      /demo/worker
  • ID: the context id, what kill, focus and reload take. * marks the shell itself.
  • PARENT: the context that ran it. - for none: the shell, or a project whose parent ended.
  • WINDOW: whether a page is open for it. A project run with --no-open has none.
  • DIRECTORY: its root, from the projects folder.

Ids are small numbers that get reused once a context ends.

focus

text
focus <id>

Brings the project's window to the front, restored if it was minimized. A running project without a window gets one. On iPhone, its page comes to the top of the stack.

The CLI (npx fullstacked) can't focus a browser tab: focus answers that it isn't supported there.

reload

text
reload <id>

Builds the project again and reloads its page in place: same id, same window. Build errors are printed and nothing is reloaded. As with any page reload, the project's plugins and streams start over. The projects it ran keep running, without a parent.

kill

text
kill [-r|--recursive] <id>...

Closes projects. Each one's page is asked to exit, which closes its window; a project that doesn't exit within 3 seconds is stopped. The projects it ran keep running without a parent, unless -r closes them too, children first.

exit --all

text
exit [--all|-a]

exit ends the shell's own context. With --all, every project it ran, and the ones those ran, close with it.

What happens to children

A project that runs another (with run, or fullstacked from its own shell) is that project's parent. When the parent ends, its children are released: they keep running, with no parent in ps. Only kill -r, exit --all and close(…, { recursive: true }) take the children along.

Opening a pin or a pinned project's link never starts it twice: the running project is found by its directory, released ones included, focused, and handed the link (see Links and params).

From code

The same operations are fullstacked/contexts: list, find, focus, reload, close and exit.