All Projects → intersystems-community → webterminal

intersystems-community / webterminal

Licence: MIT license
The first and the most powerful web-based terminal for InterSystems IRIS®, InterSystems Caché®, Ensemble®, HealthShare®, TrakCare® and other products built on top of InterSystems Data Platforms.

Programming Languages

javascript
184084 projects - #8 most used programming language
ObjectScript
12 projects
SCSS
7915 projects

Projects that are alternatives of or similar to webterminal

vscode-objectscript
InterSystems ObjectScript extension for Visual Studio Code
Stars: ✭ 94 (+32.39%)
Mutual labels:  intersystems, intersystems-cache, intersystems-ensemble, intersystems-iris
vscode-cos
Add Caché ObjectScript support for vscode
Stars: ✭ 14 (-80.28%)
Mutual labels:  intersystems, intersystems-cache, cacheobjectscript-udl
BlocksExplorer
Database Blocks Explorer for InterSystems Caché
Stars: ✭ 12 (-83.1%)
Mutual labels:  intersystems, intersystems-cache, cacheobjectscript-udl
cos-guidelines
Caché ObjectScript contibutors guidelines
Stars: ✭ 15 (-78.87%)
Mutual labels:  intersystems, intersystems-cache
zpm
InterSystems ObjectScript Package Manager
Stars: ✭ 17 (-76.06%)
Mutual labels:  intersystems, intersystems-iris
objectscript-docker-template
Template project for InterSystems ObjectScript with InterSystems IRIS community Edition docker container
Stars: ✭ 21 (-70.42%)
Mutual labels:  intersystems, intersystems-iris
Macterm
Terminal emulator for macOS with 24-bit color, bitmap and vector graphics.
Stars: ✭ 162 (+128.17%)
Mutual labels:  terminal-emulators
Extraterm
The swiss army chainsaw of terminal emulators
Stars: ✭ 1,922 (+2607.04%)
Mutual labels:  terminal-emulators
Galacritty
WIP GTK terminal emulator based on Alacritty
Stars: ✭ 136 (+91.55%)
Mutual labels:  terminal-emulators
upp-components
A collection of packages for U++ framework.
Stars: ✭ 36 (-49.3%)
Mutual labels:  terminal-emulators
archipelago
An open-source terminal emulator built on web technology
Stars: ✭ 43 (-39.44%)
Mutual labels:  terminal-emulators
Pyxtermjs
A fully functional terminal in your browser.
Stars: ✭ 127 (+78.87%)
Mutual labels:  terminal-emulators
Iterm2 Borderless
Borderless iTerm2 patch with a few extra features
Stars: ✭ 165 (+132.39%)
Mutual labels:  terminal-emulators
ShellRemoteBot
Shell remote control from telegram (SSH/terminal emulator)
Stars: ✭ 28 (-60.56%)
Mutual labels:  terminal-emulators
tabby
A terminal for a more modern age
Stars: ✭ 40,910 (+57519.72%)
Mutual labels:  terminal-emulators
Kitty
Cross-platform, fast, feature-rich, GPU based terminal
Stars: ✭ 13,011 (+18225.35%)
Mutual labels:  terminal-emulators
terminalpp
A C++ library for interacting with ANSI terminal windows.
Stars: ✭ 68 (-4.23%)
Mutual labels:  terminal-emulators
bite
Bash-integrated Terminal Emulator - rethinking the command line
Stars: ✭ 16 (-77.46%)
Mutual labels:  terminal-emulators
Contour
Modern C++ Terminal Emulator
Stars: ✭ 191 (+169.01%)
Mutual labels:  terminal-emulators
Aminal
🌘 Darktile is a GPU rendered terminal emulator designed for tiling window managers.
Stars: ✭ 2,663 (+3650.7%)
Mutual labels:  terminal-emulators

Web Terminal

Gitter

Web-based terminal for InterSystems products. Access your database from everywhere!

Preview

Syntax highlighting & intelligent autocomplete!

2016-09-18_212035

Embedded SQL mode!

2016-09-18_212244

Even more features!

2016-09-18_212325

Key Features

Native browser application Allows to access Caché terminal both from desktop and mobile devices.
Autocompletion Type faster. Autocomplete is available for class names, variable and global names, methods, properties, etc.
Tracing Monitor any changes in globals or files.
SQL mode A convenient way to execute SQL queries.
Syntax highlighting Intelligently highlighted input both for ObjectScript and SQL.
Favorites Save commands you execute frequently.
Security All you need is to protect /terminal/ web application, and all sessions are guaranteed to be secure.
Self-updating WebTerminal of version 4 and higher prompts to update automatically when new version is available, so you will never miss the important update.
Explore! Enjoy using WebTerminal!

Installation

Download the latest version from the project page and import downloaded XML file into any namespace. Compile imported items and the WebTerminal is ready!

Usage

After installation, you will be able to access application at http://[host]:[port]/terminal/ (slash at the end is required). Type /help there to get more information.

Integration and WebTerminal's API

To embed WebTerminal to any other web application, you can use <iframe> tag. Example:

<iframe id="terminal" src="http://127.0.0.1:57772/terminal/?ns=SAMPLES&clean=1"></iframe>

Note that terminal URL may include optional GET parameters, which are the next:

  • ns=USER Namespace to open terminal in. If the logged user has no access to this namespace, the error message will appear and no namespace changes will occur.
  • clean Start the WebTerminal without any additional information printed. It is not recommended to use this option if you are using terminal as a stand-alone tool (for everyday use), as you can miss important updates.

To use WebTerminal's API, you need to get WebTerminal instance first. Use iframe's onTerminalInit function to get it.

document.querySelector("#terminal").contentWindow.onTerminalInit(function (terminal) {
    // now work with terminal object here!
});

This function is triggered after WebTerminal establish an authorized connection.
The next table demonstrates available API. Left column are terminal object properties.

Function Description
execute(command, [options], [callback]) Executes the ObjectScript command right as if it is entered to the terminal. However, options provide an additional flags setup.
options.echo (false by default) - prints the command on the screen.
options.prompt (false by default) - prompts the user after execution (prints "NAMESPACE > " as well). If callback is passed, the output buffer will come as a first argument of the callback function.
onOutput([options], callback) By default, callback(strings) will be called before the user is prompted for input, and strings array will always contain an array of chunks of all the text printed between the prompts. For example, if user writes write 123 and presses "Enter", the strings will contain this array: ["\r\n", "123", "\r\n"]. However, when user enters write 1, 2, 3, strings will result with ["\r\n", "1", "2", "3", "\r\n"]. You can join this array with join("") array method to get the full output.
Optional options object may include stream property, which is false by default. When set to true, callback will be fired every time something is printed to the terminal simultaneously.
onUserInput(callback) callback(text, mode) is fired right after user presses enter. Argument text is a String of user input, and mode is a Number, which can be compared with one of the terminal mode constants, such as MODE_PROMPT.
removeCallback(callback) Remove any previously assigned callback. Any function which accepts callback returns it, and you can pass the callback here once you no longer need it to stop it from firing.
print(text) Prints text which can include special characters and escape sequences. This function is input-safe, and you can print event when terminal is requesting for input without disrupting input. In this case the input will reappear right after text printed.
Constant Description
MODE_PROMPTRegular input (ObjectScript command)
MODE_SQLInput in SQL mode (SQL command)
MODE_READPrompt issued by ObjectScript read c command
MODE_READ_CHARPrompt issued by ObjectScript read *c command
MODE_SPECIALSpecial CWT's input (commands like /help, /config etc)

The next example demonstrates a way to intercept terminal's input:

let iFrame = document.querySelector("#terminal");

function myInitHandler (terminal) {
    terminal.execute("set hiddenVariable = 7", {
        echo: false // the default is false, this is just a demo
    });
    terminal.onUserInput((text, mode) => {
        if (mode !== terminal.MODE_PROMPT)
            return;
        terminal.print("\r\nYou've just entered the next command: " + text);
    });
    terminal.onOutput((chunks) => {
        // If you "write 12", chunks are ["\r\n", "12", "\r\n"].
        // If you "write 1, 2", chunks are ["\r\n", "1", "2", "\r\n"].
        if (chunks.slice(1, -1).join("") === "duck") { // if the user enters: write "duck"
            alert(`You've found a secret phrase!`);
        }
    });
}

// At first, handle iFrame load event. Note that the load handler won't work
// if this code is executed at the moment when iFrame is already initialized.
iFrame.addEventListener("load", function () {
    iFrame.contentWindow.onTerminalInit(myInitHandler); // handle terminal initialization
});

WebTerminal Project Development

We are glad to see anyone who want to contribute to Web Terminal development! Check our developer's guide.

To be short, the "hot start" is extremely easy. Having latest Git and NodeJS installed (tested on NodeJS v4-8), execute the following:

git clone https://github.com/intersystems-ru/webterminal
cd webterminal # enter repository directory
import         # build & import the project. YOU NEED TO EDIT CONSTANTS IN THIS FILE FIRST

Now, in build folder you will find WebTerminal-v*.xml file. Every time your changes are ready to be tested, just run import again.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].