diff --git a/.gitignore b/.gitignore
index cb7551a6..bf0c3d8c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,6 +14,15 @@ npm-debug.log
build/
.vscode/
.DS_Store
+fixtures/typings-test/*.js
# Directories needed for code coverage
/coverage/
+
+# Keep legacy files out of the repo, this can be removed when we merge v3 into master
+dist/
+src/utils/TestUtils.ts
+src/xterm.js
+
+# Keep the demo builds out of Git
+demo/dist/
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 00000000..e69de29b
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 657f9915..f78b3f81 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,9 +1,8 @@
{
"search.exclude": {
"**/node_modules": true,
- "**/bower_components": true,
"**/dist": true,
"**/build": true,
"**/lib": true
}
-}
\ No newline at end of file
+}
diff --git a/Dockerfile b/Dockerfile
index 1f0db1f9..22556f43 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM node:6.9
+FROM node:6
MAINTAINER Paris Kasidiaris
# Set the working directory
@@ -6,7 +6,7 @@ WORKDIR /usr/src/app
# Set an entrypoint, to automatically install node modules
ENTRYPOINT ["/bin/bash", "-c", "if [[ ! -d node_modules ]]; then npm install; fi; exec \"${@:0}\";"]
-CMD ["npm", "run", "dev"]
+CMD ["npm", "run", "start"]
# First, install dependencies to improve layer caching
COPY package.json /usr/src/app/
diff --git a/Procfile.dev b/Procfile.dev
deleted file mode 100644
index 8d2c5445..00000000
--- a/Procfile.dev
+++ /dev/null
@@ -1 +0,0 @@
-web: npm run dev
diff --git a/README.md b/README.md
index ebf9042e..819fdb32 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-# [](https://xtermjs.org)
+# [](https://xtermjs.org)
-[](https://travis-ci.org/sourcelair/xterm.js) [](https://coveralls.io/github/sourcelair/xterm.js) [](https://gitter.im/sourcelair/xterm.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
+[](https://travis-ci.org/xtermjs/xterm.js) [](https://coveralls.io/github/sourcelair/xterm.js) [](https://gitter.im/sourcelair/xterm.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [](https://www.jsdelivr.com/package/npm/xterm)
Xterm.js is a terminal front-end component written in JavaScript that works in the browser.
@@ -19,6 +19,75 @@ It enables applications to provide fully featured terminals to their users and c
- Xterm.js is not a terminal application that you can download and use on your computer
- Xterm.js is not `bash`. Xterm.js can be connected to processes like `bash` and let you interact with them (provide input, receive output)
+## Getting Started
+
+First you need to install the module, we ship exclusively through [npm](https://www.npmjs.com/) so you need that installed and then add xterm.js as a dependency by running:
+
+```
+npm install
+```
+
+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 `` onto which xterm can attach itself.
+
+```html
+
+
+
+
+
+
+
+
+
+
+
+```
+
+Finally instantiate the `Terminal` object and then call the `open` function with the DOM object of the `div`.
+
+### Importing
+
+The proposed way to load xterm.js is via the ES6 module syntax.
+
+```javascript
+import { Terminal } from 'xterm';
+```
+
+*Note: There are currently no typings for addons so you will need to upcast if using TypeScript, eg. `(xterm).fit()`.*
+
+### Addons
+
+Addons are JavaScript modules that extend the `Terminal` prototype with new methods and attributes to provide additional functionality. There are a handful available in the main repository in the `src/addons` directory and you can even write your own, by using xterm.js' public API.
+
+To use an addon, just import the JavaScript module and pass it to `Terminal`'s `applyAddon` method:
+
+```javascript
+import { Terminal } from xterm;
+import * as fit from 'xterm/lib/addons/fit/fit';
+
+
+Terminal.applyAddon(fit);
+
+var xterm = new Terminal(); // Instantiate the terminal
+xterm.fit(); // Use the `fit` method, provided by the `fit` addon
+```
+
+## Browser Support
+
+Since xterm.js is typically implemented as a developer tool, only modern browsers are supported officially. Here is a list of the versions we aim to support:
+
+- Chrome latest
+- Edge latest
+- Firefox latest
+- Safari latest
+- IE11
+
+Xterm.js works seamlessly in Electron apps and may even work on earlier versions of the browsers but these are the browsers we strive to keep working.
+
## Real-world uses
Xterm.js is used in several world-class applications to provide great terminal experiences.
@@ -43,35 +112,24 @@ Xterm.js is used in several world-class applications to provide great terminal e
- [**SSHy**](https://github.com/stuicey/SSHy): HTML5 Based SSHv2 Web Client with E2E encryption utilising `xterm.js`, SJCL & websockets.
- [**JupyterLab**](https://github.com/jupyterlab/jupyterlab): An extensible
computational environment for Jupyter, supporting interactive data science and scientific computing across all programming languages.
+- [**Theia**](https://github.com/theia-ide/theia): Theia is a cloud & desktop IDE framework implemented in TypeScript.
+- [**Opshell**](https://github.com/ricktbaker/opshell) Ops Helper tool to make life easier working with AWS instances across multiple organizations.
+- [**Proxmox VE**](https://www.proxmox.com/en/proxmox-ve): Proxmox VE is a complete open-source platform for enterprise virtualization. It uses xterm.js for container terminals and the host shell.
- [**Script Runner**](https://github.com/ioquatix/script-runner): Run scripts (or a shell) in Atom.
- [**Whack Whack Terminal**](https://github.com/Microsoft/WhackWhackTerminal): Terminal emulator for Visual Studio 2017.
- [**VTerm**](https://github.com/vterm/vterm): Extensible terminal emulator based on Electron and React.
-
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 in our list.
-## Browser Support
-
-Since xterm.js is typically implemented as a developer tool, only modern browsers are supported officially. Here is a list of the versions we aim to support:
-
-- Chrome 48+
-- Edge 13+
-- Firefox 44+
-- Internet Explorer 11+
-- Opera 35+
-- Safari 8+
-
-Xterm.js works seamlessly in Electron apps and may even work on earlier versions of the browsers but these are the browsers we strive to keep working.
-
## Demo
### Linux or macOS
-Run the following commands:
+First, be sure that a C++ compiler such as GCC-C++ or Clang is installed, then run these commands:
```
-$ npm install
-$ npm start
+npm install
+npm start
```
Then open http://0.0.0.0:3000 in a web browser.
@@ -80,53 +138,14 @@ Then open http://0.0.0.0:3000 in a web browser.
First, ensure [node-gyp](https://github.com/nodejs/node-gyp) is installed and configured correctly, then run these commands.
-Note: Do not use ConEmu, as it seems to break the demo for some reason.
-
```
-> npm install
-> npm start
+npm install
+npm start
```
Then open http://127.0.0.1:3000 in a web browser.
-## Getting Started
-
-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 `` onto which xterm can attach itself.
-```html
-
-
-
-
-
-
-
-
-
-
-
-```
-Finally instantiate the `Terminal` object and then call the `open` function with the DOM object of the `div`.
-
-## Addons
-
-Addons are JavaScript modules that attach functions to the `Terminal` prototype to extend its functionality. There are a handful available in the main repository in the `dist/addons` directory, you can even write your own (though they may break when the internals of xterm.js change across versions).
-
-To use an addon, just include the JavaScript file after xterm.js and before the `Terminal` object has been instantiated. The function should then be exposed on the `Terminal` object:
-
-```html
-
-
-```
-
-```js
-var xterm = new Terminal();
-// init code...
-xterm.fit();
-```
+*Note: Do not use ConEmu, as it seems to break the demo for some reason.*
## Releases
diff --git a/bin/prepare-release b/bin/prepare-release
index 464e65b4..fed7919e 100755
--- a/bin/prepare-release
+++ b/bin/prepare-release
@@ -12,12 +12,6 @@ CURRENT_PACKAGE_JSON_VERSION=$(cat package.json \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g' \
| tr -d '[[:space:]]')
-CURRENT_BOWER_JSON_VERSION=$(cat bower.json \
- | grep version \
- | head -1 \
- | awk -F: '{ print $2 }' \
- | sed 's/[",]//g' \
- | tr -d '[[:space:]]')
# Build xterm.js into `dist`
export BUILD_DIR=dist
@@ -26,9 +20,8 @@ npm run build
# Update AUTHORS file
sh bin/generate-authors
-# Update version in package.json and bower.json
+# Update version in package.json
sed -i "s/\"version\": \"$CURRENT_PACKAGE_JSON_VERSION\"/\"version\": \"$NEW_VERSION\"/g" package.json
-sed -i "s/\"version\": \"$CURRENT_BOWER_JSON_VERSION\"/\"version\": \"$NEW_VERSION\"/g" bower.json
git commit -S -s -a -m "Bump version to $NEW_VERSION"
git tag $NEW_VERSION
diff --git a/bower.json b/bower.json
deleted file mode 100644
index 429cb86c..00000000
--- a/bower.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "xterm.js",
- "version": "2.9.2",
- "ignore": ["demo", "test", ".gitignore"],
- "main": [
- "dist/xterm.js",
- "dist/xterm.css"
- ]
-}
diff --git a/demo/app.js b/demo/app.js
index 8637dad8..7604e9cd 100644
--- a/demo/app.js
+++ b/demo/app.js
@@ -17,8 +17,12 @@ app.get('/style.css', function(req, res){
res.sendFile(__dirname + '/style.css');
});
-app.get('/main.js', function(req, res){
- res.sendFile(__dirname + '/main.js');
+app.get('/dist/bundle.js', function(req, res){
+ res.sendFile(__dirname + '/dist/bundle.js');
+});
+
+app.get('/dist/bundle.js.map', function(req, res){
+ res.sendFile(__dirname + '/dist/bundle.js.map');
});
app.post('/terminals', function (req, res) {
diff --git a/demo/index.html b/demo/index.html
index ee765c20..93399f9c 100644
--- a/demo/index.html
+++ b/demo/index.html
@@ -7,11 +7,6 @@
-
-
-
-
-
xterm.js: xterm, in the browser
@@ -38,6 +33,17 @@
+
+
+
@@ -59,6 +65,6 @@
Attention: The demo is a barebones implementation and is designed for xterm.js evaluation purposes only. Exposing the demo to the public as is would introduce security risks for the host.