> For the complete documentation index, see [llms.txt](https://docs.sacruda.nl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sacruda.nl/developers/sacruda-apis/the-terminal-window.md).

# The terminal window

Starting in Sacruda 7.0.6, you can easily create a terminal window to display text to the user dynamically. Sacruda's `TerminalWindow` is also used internally to display the Sacruda Terminal in a window.

To create a terminal window, call the user daemon method:

<pre class="language-javascript"><code class="lang-javascript">const terminal = await daemon?.helpers?.TerminalWindow(this.<a data-footnote-ref href="#user-content-fn-1">pid</a>);
</code></pre>

This can return `undefined` if something went wrong, so be sure to check it. This function normally returns an expanded instance of xtermjs, including the process of the terminal window as the `process` property. To learn how to use the `Terminal` interface, reference the xtermjs documentation: <https://xtermjs.org/docs/api/terminal/classes/terminal/>

### The process

As mentioned earlier, the `TerminalWindow` method returns the process as a property. This is just a regular `AppProcess`, an instance of `TerminalWindowRuntime` to be exact. So, to close the terminal, just call `terminal.process?.closeWindow()` as you would anywhere else. This will properly dispose of the process.

[^1]: This is the parent pid on which to spawn the terminal window process
