• Stars
    star
    1,547
  • Rank 30,110 (Top 0.6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 11 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A terminal written in javascript.

term.js

A full xterm clone written in javascript. Used by tty.js.

โš ๏ธ This project is no longer maintained โš ๏ธ. For a maintained fork take a look at sourcelair/xterm.js.

Example

Server:

var term = require('term.js');
app.use(term.middleware());
...

Client:

window.addEventListener('load', function() {
  var socket = io.connect();
  socket.on('connect', function() {
    var term = new Terminal({
      cols: 80,
      rows: 24,
      screenKeys: true
    });

    term.on('data', function(data) {
      socket.emit('data', data);
    });

    term.on('title', function(title) {
      document.title = title;
    });

    term.open(document.body);

    term.write('\x1b[31mWelcome to term.js!\x1b[m\r\n');

    socket.on('data', function(data) {
      term.write(data);
    });

    socket.on('disconnect', function() {
      term.destroy();
    });
  });
}, false);

Tmux-like

While term.js has always supported copy/paste using the mouse, it now also supports several keyboard based solutions for copy/paste.

term.js includes a tmux-like selection mode (enabled with the screenKeys option) which makes copy and paste very simple. Ctrl-A enters prefix mode, from here you can type Ctrl-V to paste. Press [ in prefix mode to enter selection mode. To select text press v (or space) to enter visual mode, use hjkl to navigate and create a selection, and press Ctrl-C to copy.

Ctrl-C (in visual mode) and Ctrl-V (in prefix mode) should work in any OS for copy and paste. y (in visual mode) will work for copying only on X11 systems. It will copy to the primary selection.

Note: Ctrl-C will also work in prefix mode for the regular OS/browser selection. If you want to select text with your mouse and copy it to the clipboard, simply select the text and type Ctrl-A + Ctrl-C, and Ctrl-A + Ctrl-V to paste it.

For mac users: consider Ctrl to be Command/Apple above.

Contribution and 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. </legalese>

License

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

More Repositories

1

blessed

A high-level terminal interface library for node.js.
JavaScript
11,260
star
2

tty.js

A terminal for your browser, using node/express/socket.io
JavaScript
4,184
star
3

ttystudio

A terminal-to-gif recorder minus the headaches.
JavaScript
3,237
star
4

compton

A compositor for X11.
C
2,245
star
5

pty.js

Bindings to forkpty(3) for node.js.
C++
855
star
6

mako

Bitcoin node written in C
C
572
star
7

termcoin

A bitcoin wallet and blockchain explorer for your terminal.
JavaScript
480
star
8

liburkel

Authenticated key-value store (i.e. an urkel tree)
C
303
star
9

zest

An absurdly fast CSS selector engine.
JavaScript
238
star
10

slock

Fork of suckless screen locker for the extremely paranoid.
C
152
star
11

tiny

A small database for node.js.
JavaScript
111
star
12

lcdb

LevelDB implemented in C (unofficial -- not affiliated with Google in any way)
C
94
star
13

bns

Recursive DNS server and resolver for node.js
JavaScript
66
star
14

parted

Streaming body parser for node.js.
JavaScript
63
star
15

bthreads

worker threads for javascript
JavaScript
48
star
16

bpkg

Bundler and release tool for node.js
JavaScript
44
star
17

tng

A full-featured PNG renderer for the terminal.
JavaScript
41
star
18

coined

A high-level wrapper around BCoin
JavaScript
25
star
19

node-uo

A UO server for node.js
JavaScript
25
star
20

n64

Int64 object for javascript
JavaScript
24
star
21

liquor

A templating engine minus the code.
JavaScript
19
star
22

daemonic

A dead-simple module to daemonize a node. No compilation required.
JavaScript
19
star
23

node-telnet2

Telnet implementation for node.js, based on node-telnet
JavaScript
18
star
24

gitj

gitk in your terminal.
JavaScript
15
star
25

node-pingback

pingbacks for node.js
JavaScript
15
star
26

dilated

A blog for node.js.
JavaScript
14
star
27

csslike

A CSS preprocessor for node.js, designed to conform to the most recent www-style proposals.
CSS
12
star
28

cmake-node

node.js toolchain for cmake
C
11
star
29

rondo

DOM library and app framework.
JavaScript
11
star
30

st

A fork of st implementing scrollback, keyboard selection, and tabs.
C
11
star
31

highlighter.js

a quick and dirty JS highlighter
JavaScript
10
star
32

charged

High-level Chargify API binding for node.js
JavaScript
10
star
33

supersha

Fast SHA256 for node.js
C
10
star
34

dwm

My dwm fork and configuration.
C
10
star
35

tmux

A fork of tmux implementing xterm behavior.
C
8
star
36

vanilla

A framework for node.js.
JavaScript
8
star
37

Live-Stylesheets

small google chrome extension for editing a page's raw css
JavaScript
8
star
38

shim.htc

An HTML5 Shim in an HTML Component
JavaScript
8
star
39

epsilon-not

Weblog
PHP
5
star
40

unbound

Bindings to libunbound for node.js
C
5
star
41

evilpart

A Node multipart parser that is positively evil
JavaScript
5
star
42

N

pretty control for js
JavaScript
5
star
43

nmterm

A wicd-curses-like interface for NetworkManager
JavaScript
5
star
44

pulsemixer.js

An alsamixer-like interface for PulseAudio
JavaScript
4
star
45

rocksdown

RocksDB backend for LevelUP
C++
4
star
46

bsert

Minimal assertions for javascript
JavaScript
4
star
47

bitcoind.js

bitcoind.js has moved to https://github.com/bitpay/bitcoind.js
C++
4
star
48

wazm

WASM abstraction and EMCC preamble
JavaScript
3
star
49

babylonia

zero-dependency babel
JavaScript
3
star
50

bslint

eslint with less (or more) bullshit
JavaScript
3
star
51

bdoc

zero-dependency jsdoc
JavaScript
3
star
52

pkg-verify

Dependency verifier for node.js
JavaScript
3
star
53

buffer-map

Buffer-keyed map for javascript
JavaScript
2
star
54

loady

dynamic loader for node.js
JavaScript
2
star
55

qrsuite

jsqrcode and qr.js rolled into one package
JavaScript
1
star