# j-Xterm

> The component renders a terminal output/input directly in the web browser. IMPORTANT: the example doesn't work as you expect, it needs a real terminal output.

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: en
Content-SHA256: f43d26911d2d7591ffed65de842c3eac83811581e34b71fc59e53c6d77baff11
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

The component renders a terminal output/input directly in the web browser. __IMPORTANT__: the example doesn't work as you expect, it needs a real terminal output.


__Configuration__:

- `cols {Number}` count of cols (default: `80`)
- `rows {Number}` count of rows (default: `24`)
- `send {String}` a link to the `function(data)` for the communication with the server

__Methods__:

- `instance.write(data)` writes data into the terminal component

__Used dependencies__:

- [Xterm.js](https://xtermjs.org/)
- [Full example](https://github.com/totaljs/examples/tree/master/remote-terminal)

Use it with `<ui-component name="xterm">`. When the component is not loaded yet, jComponent downloads it on first use from the address in `DEF.fallback` (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.

```html example.html
<ui-component name="xterm" config="send:send_to_server"></ui-component>

<script>

	function send_to_server(data) {

		// FAKE:
		// the below code will append the data directly into the terminal
		SETTER('xterm/write', data);

	}

</script>
```
