GitXplorerGitXplorer
t

zsh.js

public
52 stars
8 forks
5 issues

Commits

List of commits on branch master.
Unverified
990f8c53bb4406e80b49032ec2f1be36b3191926

Update readme

ttadeuzagallo committed 8 years ago
Unverified
544107621550b6f82471eb20d806eab40ef0e960

2.3.2

ttadeuzagallo committed 8 years ago
Unverified
7bfcaf02d3904ff83e5bdbce563e5cdd93cf9529

Fix help - don't use es6 on files that won't be compiled

ttadeuzagallo committed 8 years ago
Unverified
09f21fe0af81b20ed2e604cf4366c2b0262a9ae2

2.3.1

ttadeuzagallo committed 8 years ago
Unverified
59741a9f6195de6851a5a175dddcf08eb354586d

Remove unnecessary checks on help.js

ttadeuzagallo committed 8 years ago
Unverified
f66bf0bbeae9ddece97efed9ad899c009287c020

Expose streams

ttadeuzagallo committed 8 years ago

README

The README file for this repository.

zsh.js

An almost functional zsh terminal in any div

Instalation

You can install via npm

$ npm install zsh.js

Basic Usage

Include the script and style:

<link href="path/to/zsh.min.css" rel="stylesheet" />
<script src="path/to/zsh.js"></script>

You can either access it though a global variable ZSH or via a client side require:

var ZSH = require('zsh.js');
var FileSystem = require('zsh.js/lib/fs');
var CommandManager = require('zsh.js/lib/command-manager');

In order to display the terminal, call ZSH.create with the target div's ID:

ZSH.create('container');

Web Component

You can also include zsh.js as a web component:

<link rel="import" href="path/to/zsh.js/zsh-terminal.html"/>

<zsh-terminal></zsh-terminal>

An example is also available

Features

The commands, such as cd and mv, are written in javascript and hosted at /usr/bin. You can ls directory to see which commands are currently implemented, cat a command to see its implementation, check the contents of lib/fs/usr/bin or simply run help, which will show you all the aliases and commands available.

Some other functionalities include:

  • Autocomplete for commands
  • Syntax Highlight
  • Commands History

Contributing

Executable files are stored inside the actual file system folder and can be viewed within the terminal. The path is not customizable yet, so all the commands are in src/lib/fs/usr/bin/*.js

Notice that: It is still possible to add commands through the CommandManager, but they are not automatically required, but could work if you are writing a plugin (example: tadeuzagallo.com/src/js/site-helpers.js)

The most complex command so far is mv.js, check it out if you want to implement a custom command.

License

Terminal.js is available under MIT licence. See the LICENCE file for more info.