You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
477 B
22 lines
477 B
|
2 years ago
|
# Notes About Xterm.js
|
||
|
|
|
||
|
|
Those are the main api exported by xterm.js,
|
||
|
|
|
||
|
|
This is used as reference to build a platform agnostic terminal emulator (TTkTerminal)
|
||
|
|
|
||
|
|
```javascript
|
||
|
|
// Init
|
||
|
|
var term = new Terminal({allowProposedApi: true});
|
||
|
|
|
||
|
|
// Write to the terminal
|
||
|
|
term.write('xterm.js - Loaded\n\r')
|
||
|
|
|
||
|
|
// Resize Event
|
||
|
|
term.onResize( (obj) => {
|
||
|
|
term.reset()
|
||
|
|
ttk_resize(obj.cols, obj.rows)
|
||
|
|
});
|
||
|
|
|
||
|
|
// Input Event
|
||
|
|
term.onData((d, evt) => { ttk_input(d) })
|
||
|
|
```
|