Go to file
Paris Kasidiaris 081fe3f301 Fix #359 - Introduce build system based on Gulp
- Add Gulp and new dependencies to `package.json`
- Add `gulpfile.js` with four tasks:
    - `tsc`: For building TypeScript sources
    - `bundle`: For bundling JavaScript modules in a monolith
    - `sorcery`: For resolving the source map chains back to the original TypeScript files
    - `build` (`default`): Runs the whole `tsc` → `bundle` → `sorcery` chain
- Clean up `Dockerfile`, since `cpio` is not needed any more
- Clean up not needed dependencies from `package.json`
- Remove `bin/build`
- Update `bin/release` to use `npm run build` instead of `./bin/build`
2017-01-11 08:11:45 +00:00
.github Improve issue template 2016-07-18 09:36:39 +03:00
bin Fix #359 - Introduce build system based on Gulp 2017-01-11 08:11:45 +00:00
demo Bring back the build directory for temporary builds 2016-12-05 13:17:13 +02:00
dist Bump version to 2.2.2 2016-12-15 17:16:04 +00:00
src Fix #359 - Introduce build system based on Gulp 2017-01-11 08:11:45 +00:00
.dockerignore Ignore all the build directories in Docker 2016-12-29 16:13:58 +02:00
.editorconfig Fix EOL character in .editorconfig and update docker-compose 2016-12-28 18:49:36 +02:00
.gitignore Improve the package.json scripts 2016-12-28 18:12:20 +02:00
.mailmap Add AUTHORS and AUTHORS generator script 2016-07-18 10:04:04 +03:00
.npmignore Do not publish test files to npm 2016-12-13 23:28:33 +00:00
.travis.yml Parallelise build 2016-12-15 14:05:37 +02:00
AUTHORS Bump version to 2.2.2 2016-12-15 17:16:04 +00:00
bower.json Bump version to 2.2.3 2016-12-15 21:56:32 +00:00
CONTRIBUTING.md Add CONTRIBUTING.md 2016-07-17 18:55:49 +00:00
docker-compose.yaml Fix EOL character in .editorconfig and update docker-compose 2016-12-28 18:49:36 +02:00
Dockerfile Fix #359 - Introduce build system based on Gulp 2017-01-11 08:11:45 +00:00
gulpfile.js Fix #359 - Introduce build system based on Gulp 2017-01-11 08:11:45 +00:00
jsdoc.json Update documentation with cleaner license declaration 2016-12-01 13:37:20 +00:00
LICENSE Update copyright text in all files 2016-09-30 13:52:55 +03:00
package.json Fix #359 - Introduce build system based on Gulp 2017-01-11 08:11:45 +00:00
Procfile Add a Procfile with the npm start command 2016-12-28 18:12:23 +02:00
Procfile.dev Add a Procfile with the npm start command 2016-12-28 18:12:23 +02:00
README.md Add Codenvy to the list of xTerm supporters 2017-01-08 17:41:02 -08:00
tsconfig.json Fix #359 - Introduce build system based on Gulp 2017-01-11 08:11:45 +00:00
tslint.json Add tslint 2016-12-15 13:53:26 +02:00
typings.json Move to TypeScript build 2016-10-01 00:29:33 -07:00

xterm.js

xterm.js build status Gitter

Xterm.js is a terminal front-end component written in JavaScript that works in the browser.

It enables applications to provide fully featured terminals to their users and create great development experiences.

Features

  • Text-based application support: Use xterm.js to work with applications like bash, git etc.
  • Curses-based application support: Use xterm.js to work with applications like vim, tmux etc.
  • Mouse events support: Xterm.js captures mouse events like click and scroll and passes them to the terminal's back-end controlling process
  • CJK (Chinese, Japanese, Korean) character support: Xterm.js renders CJK characters seamlessly
  • IME support: Insert international (including CJK) characters using IME input with your keyboard
  • Self-contained library: Xterm.js works on its own. It does not require any external libraries like jQuery or React to work
  • Modular, event-based API: Lets you build addons and themes with ease

What xterm.js is not

  • 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)

Real-world uses

Xterm.js is used in several world-class applications to provide great terminal experiences.

  • SourceLair: In-browser IDE that provides its users with fully-featured Linux terminals based on xterm.js
  • Microsoft Visual Studio Code: Modern, versatile and powerful open source code editor that provides an integrated terminal based on xterm.js
  • ttyd: A command-line tool for sharing terminal over the web, with fully-featured terminal emulation based on xterm.js
  • Katacoda: Katacoda is an Interactive Learning Platform for software developers, covering the latest Cloud Native technologies.
  • Eclipse Che: Developer workspace server, cloud IDE, and Eclipse next-generation IDE.
  • Codenvy: Cloud workspaces for development teams.

Do you use xterm.js in your application as well? Please open a Pull Request 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

To launch the demo simply run:

npm install
npm start

Then open http://0.0.0.0:3000 in a web browser (use http://127.0.0.1:3000 if running under Windows).

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 <div id="terminal"></div> onto which xterm can attach itself.

<!doctype html>
  <html>
    <head>
      <link rel="stylesheet" href="bower_components/xterm.js/dist/xterm.css" />
      <script src="bower_components/xterm.js/dist/xterm.js"></script>
    </head>
    <body>
      <div id="terminal"></div>
      <script>
      	var term = new Terminal();
        term.open(document.getElementById('#terminal'));
        term.write('Hello from \033[1;3;31mxterm.js\033[0m $ ')
      </script>
    </body>
  </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:

<script src="node_modules/dist/xterm.js"></script>
<script src="node_modules/dist/addons/fit/fit.js"></script>
var xterm = new Terminal();
// init code...
xterm.fit();

Releases

Xterm.js follows a monthly release cycle roughly.

The existing releases are available at this GitHub repo's Releases, while the roadmap is available as Milestones.

Development and Contribution

Xterm.js is maintained by SourceLair and a few external contributors, but we would love to receive contributions from everyone!

To contribute either code, documentation or issues to xterm.js please read the Contributing document before.

The development of xterm.js does not require any special tool. All you need is an editor that supports JavaScript and a browser (if you would like to run the demo you will need Node.js to get all features).

It is recommended though to use a development tool that uses xterm.js internally, to develop for xterm.js. Eating our own dogfood has been proved extremely beneficial for this project. Known tools that use xterm.js internally are:

SourceLair

Visit https://lair.io/sourcelair/xterm and follow the instructions. All development will happen in your browser.

Visual Studio Code

Download Visual Studio Code, clone xterm.js and you are all set.

Eclipse Che

You can start Eclipse Che with docker run eclipse/che start.

Codenvy

You can create a trial account or install an enterprise version with docker run codenvy/cli start.

License Agreement

If you contribute code to this project, you are implicitly allowing your code to be distributed under the MIT license. You are also implicitly verifying that all code is your original work.

Copyright (c) 2014-2016, SourceLair, Private Company (www.sourcelair.com) (MIT License)

Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)