Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use DomTerm instead of xterm for terminal #1204

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
81ac51e
Replace xterm.js terminal emulator with DomTerm.
PerBothner Feb 2, 2018
7620364
Fix handleReportEvent.
PerBothner Feb 2, 2018
4c09186
Fix link.
PerBothner Feb 2, 2018
0229f02
New file src/domterm/README.md.
PerBothner Feb 2, 2018
8e4fc19
Set DomTerm.versionString if not set.
PerBothner Feb 2, 2018
5736f0f
More information in README-DomTerm.md.
PerBothner Feb 2, 2018
d141f33
Tweaks to README-DomTerm.md.
PerBothner Feb 2, 2018
c7326b1
Added to Issues list in README-DomTerm.md.
PerBothner Feb 3, 2018
10de9bb
Note that flow-control is not implemented.
PerBothner Feb 6, 2018
78392f5
Merge domterm-version.js into terminal.js.
PerBothner Feb 6, 2018
bc0172d
Merge new update script to extract resources from DomTerm upstream.
PerBothner Feb 6, 2018
0f7b08b
Imported updates from DomTerm upstream.
PerBothner Feb 12, 2018
a5f4e89
Added a comment.
PerBothner Feb 12, 2018
03eadc7
Add upstream DomTerm as a dependency.
PerBothner Feb 12, 2018
bb8b3a2
Merge branch 'master' of https://github.com/theia-ide/theia
PerBothner Feb 23, 2018
a5d2a80
Update from upstream DomTerm.
PerBothner Feb 23, 2018
94ec398
Set DOMTERM and COLORTERM environment variables.
PerBothner Feb 24, 2018
941a8a8
Update to DomTerm 0.99.
PerBothner Mar 15, 2018
eccaa64
Change setFocus calls to doFocus so we actually do request focus.
PerBothner Mar 15, 2018
d1c3bb3
Update from upstream DomTerm.
PerBothner Mar 15, 2018
8d72c7c
Pass Ctrl-Shift-L and Ctrl-Shift-M to DomTerm.
PerBothner Mar 15, 2018
d8a6a16
Update update.sh to also copy browserkeymap.js.
PerBothner Mar 25, 2018
d028896
Update from DomTerm upstream.
PerBothner Mar 25, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions README-DomTerm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Benefits and issues with using Domterm

See [home page](http://domterm.org) and
[this introductory article](https://opensource.com/article/18/1/introduction-domterm-terminal-emulator) for more information.

## Benefits

Better vt*nnn*/xterm compatibility, as demonstrated by the [vttest testsuite](https://invisible-island.net/vttest/vttest.html).

You can embed graphics, html text, and more in the output.
For example help text can be rich html text.
(`domterm help` by default emits rich text on DomTerm.)

Output folding (show/hide buttons).

Compiler and other error messages (of the form *filename*:*line*) are clickable.
(Needs hooking in Theia.)

Move cursor in bash or other readline-based program with mouse.
(Requires setting of special escape sequences in prompt.)

Builtin LISP-style pretty-printer with re-flow on window re-size.

Optional line-editing for program that don't have readline or similar.
(Potentially could use Monaco key-bindings and edit actions.)

Optional built-in pager (like `less`).

## Issues

A styling problem with the scroll-bar - it's almost invisible.

Should set DOMTERM environment variable. That requires domterm-version.js.

Automatic input mode (swiching between characater-at-a-time and
line-editing mode based on therm state) is not implemented.
That requires a cll to `tcgetattr`.

Handling of clicked links is not implemented.
File links with line numbers should open a file in the editor;
other links should by default open the link in a browser.
(The domterm program supports a flexible if complex way
to specify how such links are handled.)

Flow-control (output rate limitation) is not implemented.
This is related to the paging/pause support.

## Using domterm program

The domterm program (see [build instructions](http://domterm.org/Downloading-and-building.html))
provides a number of useful features beyond just starting a terminal emulator.
For example the `domterm imgcat` sub-command lets you "print"
an image to the current terminal.
This and similar "client" sub-commands work under Theia's domterm embedding.

The domterm program has useful "server-side" features that could be
re-implemented in typescript/node, but it may make more sense
to use the domterm command itself from Theia. That gives us
a lot of features already implemented: Session management (attach/save/detach);
handling of clicked links; flow control; watching and parsing the
`settings.ini` preferences file (a more friendly syntax that JSON).

Communication between the DomTerm JavaScript code and the domterm
program usea a WebSocket, so it shouldn't be to hard to provide
a mode for the Theia terminal to use the domterm program.
(Using external `domterm`, if available, should be a user preference.)
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Theia - Cloud & Desktop IDE

This is a fork to use [DomTerm](http://domterm.org/) for the terminal
emulator, in place of xterm.js.
See [README-DomTerm.md](./README-DomTerm.md) for more information.

[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/theia-ide/theia/labels/help%20wanted)
[![Gitter](https://img.shields.io/badge/chat-on%20gitter-blue.svg)](https://gitter.im/theia-ide/theia)
[![Build Status](https://travis-ci.org/theia-ide/theia.svg?branch=master)](https://travis-ci.org/theia-ide/theia)
Expand Down
1 change: 1 addition & 0 deletions packages/terminal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.3.7",
"description": "Theia - Terminal Extension",
"dependencies": {
"domterm": "git+https://[email protected]/PerBothner/DomTerm.git",
"@theia/core": "^0.3.7",
"@theia/filesystem": "^0.3.7",
"@theia/process": "^0.3.7",
Expand Down
10 changes: 10 additions & 0 deletions packages/terminal/src/browser/terminal-frontend-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ export class TerminalFrontendContribution implements CommandContribution, MenuCo
});
};

const regCtrlShift = (k: Key) => {
keybindings.registerKeybindings({
command: KeybindingRegistry.PASSTHROUGH_PSEUDO_COMMAND,
keybinding: KeyCode.createKeyCode({ first: k, modifiers: [KeyModifier.CTRL, KeyModifier.SHIFT] }).toString(),
context: TERMINAL_ACTIVE_CONTEXT,
});
};

/* Register alt + k (the passed Key) as a passthrough command in the
context of the terminal. */
const regAlt = (k: Key) => {
Expand All @@ -96,6 +104,8 @@ export class TerminalFrontendContribution implements CommandContribution, MenuCo
context: TERMINAL_ACTIVE_CONTEXT,
});
};
regCtrlShift(Key.KEY_L); // Cycle input modes
regCtrlShift(Key.KEY_M); // Pager prefix character

/* ctrl-space (000 - NUL). */
regCtrl(Key.SPACE);
Expand Down
5 changes: 3 additions & 2 deletions packages/terminal/src/browser/terminal-frontend-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ import { TerminalWatcher } from '../common/terminal-watcher';
import { IShellTerminalServer, shellTerminalPath } from '../common/shell-terminal-protocol';
import { ApplicationShell, KeybindingContribution } from '@theia/core/lib/browser';

import '../../src/browser/terminal.css';
import 'xterm/lib/xterm.css';
import '../../src/domterm/domterm-core.css';
import '../../src/domterm/domterm-standard.css';
import '../../src/domterm/domterm-default.css';

export default new ContainerModule(bind => {
bind(TerminalWidget).toSelf().inTransientScope();
Expand Down
Loading