Go to file
Tyler Jewell 520f2bc9d6 Add additional products that use xTerm
Hi xTerm team. Over the past 6 months, we have been studying xTerm as a replacement for Eclipse Che's term.js. It's taken us a bit of an effort, but the work is now done!  You can expect that Eclipse Che engineers (abot 60 contributors) will make direct contributions back to xTerm ongoing now that we are fully integrated in. We integrate xTerm alongside GWT.  As we more natively integrate the solution, we'll make additional PRs directly back to the project.

As background on the research and integration work that we did, these are the postings from our engineering team's research from the past six months. Some of these issues have already been resolved, or in the process of being resolved.

We also plan a couple of blog posts to our forums (~250K followers) about xTerm integration later in Q1 after we make our 5.0.0 announcements. I could also add Codenvy to this PR as well since it has been released with the version based upon xTerm, but with Sourcelair being the initiators we didn't want to make it seem like we were trying to be competitive. This PR is about the promotion and success of xTerm, for which we are fully committed to.

## Xtermjs 
This document is result of investigation using xtemjs ui terminal instead of current term.js. It contains analyze pluses and minuses using xtermjs (release version 2.2.3) and technical problems.  Investigation issue: https://github.com/eclipse/che/issues/3210

## Description
For now we are using our own fork of the https://github.com/chjj/term.js for user interface websocket-terminal. But actually this project is no longer maintained. So we can not get new releases from this project and we need support this script on our own. Original project contains link for a maintained fork https://github.com/sourcelair/xterm.js. This fork uses MIT license and community intensive develops this project. It has such users like: Microsoft Visual Studio Code, SourceLair, ttyd. xterm.js had already done 46 releases https://github.com/sourcelair/xterm.js/releases.

## Technical Advantages of xTerm:
* xterm.js has js tests. We have not any test for old term.js.
* We can periodically update xtem.js by new release.
* Added parameter to cancel browser events.
* Default 256 colours moved from js to css.
* Added ability to set terminal theme.
* Improved resize mehanizm (added resize event).
* Added fit.ts script to fits terminal size to original height and width of parent div.
* Fixed lost text selection from current active line(when blink is enabled).
* Improved copy/paster mehanizm.
* Linkify URL feature.
* Implement moving back and forward across words with "Alt + ←" and "Alt + →" respectively.
* Improved special key handling.
* Added addons to exdens xterm.js
* Improved mehanizm copy/paster from clipboard.
* Fixed cross platform input problems(For IPad, Iphone, MacIntel, MacPPC and so on).
* Did some work to support UTF-8 symbols.
* Implemented scrollbar.
* Fixed incorrect mouse position for application with  pseudo-graphic user interface (for example Midnight Commander).
* Fix to prevent terminal scrolling when user is looking into scrollback(similar to gnome-terminal, if the user is scrolling up to look at past output and the currently running program adds output to the terminal, the viewport of xterm.js should not scroll and interrupt what they are looking at.)
* Make right-click work on all browsers.

##  Broken Changes: 
We can move on our changes to realize copy/paste by hotkeys Ctrl + C/Ctrl +V. But xterm.js support hotkeys more common for terminal: Ctrl + Insert and Shift + Insert and maybe that's enough.

Drop support for old mouse wheel APIs: all browsers have supported the WheelEvent (onwheel) for sometime now, since Firefox does not support onmousewheel which is also non-standard but works with the standard interface, it makes sense to drop support now.

## 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 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 xterm.js developers strive to keep working.

## Known major bugs:
https://github.com/sourcelair/xterm.js/issues/307
https://github.com/sourcelair/xterm.js/issues/362
https://github.com/sourcelair/xterm.js/issues/348
https://github.com/sourcelair/xterm.js/issues/325 Data loss when resizing terminal (but this bug is exist in the current terminal ui in the CHE too). Community has pull request to fix this issue for xtermjs https://github.com/sourcelair/xterm.js/pull/404 .
 
Additional information: 

Code base xterm.js consist of files written on native javascript and typescript. For manage js dependency and configuration used npm, typings, bower and node. Development tendency: rewrite xtemr.js completely on the Typescript(information about this included to the release notes 2.2.3).
2017-01-08 09:44:14 -08:00
.github Improve issue template 2016-07-18 09:36:39 +03:00
bin Include appropriate files in npm. 2016-12-15 23:49:43 +02: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 Merge pull request #432 from Tyriar/335_TS_EventEmitter 2016-12-31 07:14:47 -08: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 Ignore all the build directories in Docker 2016-12-29 16:13:58 +02: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 Improve the package.json scripts 2016-12-28 18:12:20 +02: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 additional products that use xTerm 2017-01-08 09:44:14 -08:00
tsconfig.json Always build TypeScript in lib/ 2016-12-14 01:10:03 +02: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

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

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)