{"version":"2.1.333","anchor":"plugin-processes-can-take-over-the-terminal-and-run-sandboxe","canonical_anchor":"plugin-processes-can-take-over-the-terminal-and-run-sandboxe","heading":"Plugin processes can take over the terminal or run sandboxed","tier":"internal","area":"Plugin API","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.333\/e\/plugin-processes-can-take-over-the-terminal-and-run-sandboxe","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.333","markdown":"### Plugin processes can take over the terminal or run sandboxed\n\nPrograms started by plugins can now borrow the session's terminal or run inside the sandbox, with new `terminal` and `sandbox` options\n\n**What**\n\nA plugin can start a separate program, called a process. Starting one now accepts two new options:\n\n- `terminal` lends the session's terminal to the program, so it can take over the screen. If the session has no terminal, it fails with \"this session has no terminal to hand over\".\n\n- `sandbox` runs the program inside the sandbox, the walled-off area that limits what commands can read and write.\n\nHow the options are handled:\n\n- Both are passed on with the existing `stdin` and `timeoutMs` options. Before, only `stdin` and `timeoutMs` were passed on. `terminal` is passed only when it is present and set, and `sandbox` only when it is set.\n\n- Both must be `true` or left out. Any other value is rejected with \"init. is true or left out\".\n\n- `terminal` cannot be combined with `stdin` or `sandbox`. The error reads \"init.terminal goes with neither init.stdin nor init.sandbox\".\n\n- The check on `timeoutMs` moved into a shared helper.\n\n- Programs launched this way are stopped with SIGHUP, the signal a program gets when its terminal closes.\n\n**Why**\n\nPlugins can now run interactive programs that need the whole terminal, such as an editor, or keep a program they start inside the sandbox. A plugin cannot ask for the terminal and the sandbox at the same time.\n\n- Area: Plugin API\n- Tier: Under the hood\n- Useful: 3\/5\n- Signal: 3\/5\n- Scope: individual\n- Heads-up: no"}