Skip to content

Commit 6813fc1

Browse files
committed
Merge remote-tracking branch 'upstream/master' into 5377_scroll
2 parents 38913e4 + 89980fc commit 6813fc1

File tree

109 files changed

+5921
-1755
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+5921
-1755
lines changed

.github/hooks/setupRepo.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"hooks": {
3+
"SessionStart": [
4+
{
5+
"type": "command",
6+
"command": "npm run agent:setup-repo"
7+
}
8+
]
9+
}
10+
}

README.md

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,36 @@ First, you need to install the module. We ship exclusively through [npm](https:/
2424
npm install --save @xterm/xterm
2525
```
2626

27-
To start using xterm.js on your browser, add the `xterm.js` and `xterm.css` to the head of your HTML page. Then create a `<div id="terminal"></div>` onto which xterm can attach itself. Finally, instantiate the `Terminal` object and then call the `open` function with the DOM object of the `div`.
27+
The recommended way to load xterm.js with the ES module syntax, either using TypeScript or a modern JS tooling. Note that both CommonJS and ES module files are shipped with the npm package.
28+
29+
```javascript
30+
import { Terminal } from '@xterm/xterm';
31+
```
32+
33+
Then instantiate a `Terminal` object, open it on an element and write to it:
34+
35+
```javascript
36+
const term = new Terminal();
37+
term.open(document.getElementById('terminal'));
38+
term.write('Hello from \x1B[1;3;31mxterm.js\x1B[0m $ ')
39+
```
40+
41+
Most use cases will hook up input and output to a pseudoterminal API such as [node-pty](https://www.npmjs.com/package/node-pty) which will drive the terminal.
42+
43+
```javascript
44+
pty.onData(data => term.write(data));
45+
term.onData(data => pty.write(data));
46+
```
47+
48+
Then make sure to also include the `css/xterm.css` file, for example in HTML:
49+
50+
```html
51+
<link rel="stylesheet" href="node_modules/@xterm/xterm/css/xterm.css" />
52+
```
53+
54+
### Standalone example
55+
56+
Here is a complete standalone example in a HTML file:
2857

2958
```html
3059
<!doctype html>
@@ -36,22 +65,14 @@ To start using xterm.js on your browser, add the `xterm.js` and `xterm.css` to t
3665
<body>
3766
<div id="terminal"></div>
3867
<script>
39-
var term = new Terminal();
68+
const term = new Terminal();
4069
term.open(document.getElementById('terminal'));
4170
term.write('Hello from \x1B[1;3;31mxterm.js\x1B[0m $ ')
4271
</script>
4372
</body>
4473
</html>
4574
```
4675

47-
### Importing
48-
49-
The recommended way to load xterm.js is via the ES6 module syntax:
50-
51-
```javascript
52-
import { Terminal } from '@xterm/xterm';
53-
```
54-
5576
### Addons
5677

5778
Addons are separate modules that extend the `Terminal` by building on the [xterm.js API](https://github.com/xtermjs/xterm.js/blob/master/typings/xterm.d.ts). To use an addon, you first need to install it in your project:
@@ -94,7 +115,7 @@ Since xterm.js is typically implemented as a developer tool, generally only mode
94115

95116
### Node.js Support
96117

97-
We also publish [`xterm-headless`](https://www.npmjs.com/package/xterm-headless) which is a stripped down version of xterm.js that runs headless in Node.js. An example use case for this is to keep track of a terminal's state where the process is running and using the [serialize addon](https://www.npmjs.com/package/@xterm/addon-serialize) so it can get all state restored upon reconnection.
118+
We also publish [`@xterm/headless`](https://www.npmjs.com/package/@xterm/headless) which is a stripped down version of xterm.js that runs headless in Node.js. An example use case for this is to keep track of a terminal's state where the process is running and using the [serialize addon](https://www.npmjs.com/package/@xterm/addon-serialize) so it can get all state restored upon reconnection.
98119

99120
## API
100121

@@ -229,6 +250,8 @@ Xterm.js is used in many world-class applications to provide great terminal expe
229250
- [**ecmaOS**](https://ecmaos.sh): A kernel and suite of applications tying modern web technologies into a browser-based operating system.
230251
- [**LabEx**](https://labex.io): Interactive learning platform with hands-on labs and xterm.js-based online terminals, focused on learn-by-doing approach.
231252
- [**EmuDevz**](https://afska.github.io/emudevz): A free coding game where players learn how to build an emulator from scratch.
253+
- [**SSH Connection Manager**](https://github.com/Amtrend/ssh-manager): Modern web-based SSH terminal and SFTP manager with AES-256 encryption, PWA support, and session management.
254+
- [**WooTTY**](https://github.com/icoretech/wootty): Flawless browser terminal for real operators.
232255
- [And much more...](https://github.com/xtermjs/xterm.js/network/dependents?package_id=UGFja2FnZS0xNjYzMjc4OQ%3D%3D)
233256

234257
Do you use xterm.js in your application as well? Please [open a Pull Request](https://github.com/sourcelair/xterm.js/pulls) to include it here. We would love to have it on our list. Please add any new contributions to the end of the list.

addons/addon-attach/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"xterm.js"
1717
],
1818
"scripts": {
19-
"build": "../../node_modules/.bin/tsc -p .",
19+
"build": "../../node_modules/.bin/tsgo -p .",
2020
"prepackage": "npm run build",
2121
"package": "../../node_modules/.bin/webpack",
2222
"prepublishOnly": "npm run package",

addons/addon-attach/test/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@
99
"outDir": "../out-test",
1010
"sourceMap": true,
1111
"removeComments": true,
12-
"baseUrl": ".",
1312
"paths": {
1413
"common/*": [
1514
"../../../src/common/*"
1615
],
1716
"browser/*": [
1817
"../../../src/browser/*"
18+
],
19+
"*": [
20+
"./*"
1921
]
2022
},
2123
"strict": true,

addons/addon-clipboard/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"xterm.js"
1717
],
1818
"scripts": {
19-
"build": "../../node_modules/.bin/tsc -p .",
19+
"build": "../../node_modules/.bin/tsgo -p .",
2020
"prepackage": "npm run build",
2121
"package": "../../node_modules/.bin/webpack",
2222
"prepublishOnly": "npm run package",

addons/addon-clipboard/test/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@
99
"outDir": "../out-test",
1010
"sourceMap": true,
1111
"removeComments": true,
12-
"baseUrl": ".",
1312
"paths": {
1413
"common/*": [
1514
"../../../src/common/*"
1615
],
1716
"browser/*": [
1817
"../../../src/browser/*"
18+
],
19+
"*": [
20+
"./*"
1921
]
2022
},
2123
"strict": true,

addons/addon-fit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"xterm.js"
1717
],
1818
"scripts": {
19-
"build": "../../node_modules/.bin/tsc -p .",
19+
"build": "../../node_modules/.bin/tsgo -p .",
2020
"prepackage": "npm run build",
2121
"package": "../../node_modules/.bin/webpack",
2222
"prepublishOnly": "npm run package",

addons/addon-fit/test/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@
99
"outDir": "../out-test",
1010
"sourceMap": true,
1111
"removeComments": true,
12-
"baseUrl": ".",
1312
"paths": {
1413
"common/*": [
1514
"../../../src/common/*"
1615
],
1716
"browser/*": [
1817
"../../../src/browser/*"
18+
],
19+
"*": [
20+
"./*"
1921
]
2022
},
2123
"strict": true,

addons/addon-image/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ const customSettings: IImageAddonOptions = {
3030
storageLimit: 128, // FIFO storage limit in MB
3131
showPlaceholder: true, // whether to show a placeholder for evicted images
3232
iipSupport: true, // enable iTerm IIP support
33-
iipSizeLimit: 20000000 // size limit of a single IIP sequence
33+
iipSizeLimit: 20000000, // size limit of a single IIP sequence
34+
kittySupport: true, // enable Kitty graphics support
35+
kittySizeLimit: 20000000 // size limit of a single Kitty sequence
3436
}
3537

3638
// initialization
123 Bytes
Loading

0 commit comments

Comments
 (0)