A terminal component that can be used in browser web applications-Xterm.js

2019/10/1012:05:10 technology 363

Introduction

Xterm.js is a front-end component written in TypeScript, which allows applications to provide users with a fully functional terminal in the browser. It is used by popular projects such as VS Code, Hyper and Theia.


A terminal component that can be used in browser web applications-Xterm.js - DayDayNews


Github(7k stars)

https://github.com/xtermjs/xterm.js

Component Features935#
  • The terminal application works normally:

Xterm.js is suitable for most terminal applications, such as bash, vim and tmux, this includes curses-based applications and mouse events Supported support

  • Performant:

Xterm.js is very fast, it even includes a GPU accelerated renderer

  • Rich unicode support:

supports CJK, emoji and IME

  • self-contained:

zero dependency

  • 059ed# accessible: 0d7#

You can use the screenReaderMode option to open the screen reader support

  • More features:

links, themes, plugins, well-documented APIs, etc.


A terminal component that can be used in browser web applications-Xterm.js - DayDayNews


Start using

First you need to install the module, only through npm, so you need to install, then run the following command to add xterm.js as a dependency Item:

npm install xterm

To start using xterm.js on the browser, please add xterm.js and xterm.css to the head of the html page. Then create a


xterm can be attached to it. Finally, instantiate the Terminal object, and then use the DOM object of the div to call the open function, as shown below:









A terminal component that can be used in browser web applications-Xterm.js - DayDayNews

3a7d#0a#3a7d#0a#Real case

Xterm.js has been used in some world-class applications to provide a good terminal experience:


A terminal component that can be used in browser web applications-Xterm.js - DayDayNews


which includes a lot of us, especially as The VSCode used by front-end developers also uses Xtem.js, and the experience is excellent!


Summary The emergence of

Xterm.js can revitalize many WebIDEs and integrate the terminal into WebIDE to achieve more powerful functions. If you have this requirement, you may wish to try Xterm. js!


A terminal component that can be used in browser web applications-Xterm.js - DayDayNews


technology Category Latest News